Merge branch 'develop' of https://github.com/mattsmida/timewarrior in… #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trigger Target Workflow | |
on: | |
push: | |
branches: | |
- develop | |
paths: | |
- 'doc/man1/**' | |
- 'doc/man7/**' | |
jobs: | |
trigger: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get changed files | |
id: get_changes | |
run: | | |
echo ::set-output name=files::$(git diff --name-only HEAD~1) | |
- name: Trigger Workflow in Another Repository | |
run: | | |
# Set the required variables | |
repo_owner="mattsmida" | |
repo_name="ti.net" | |
event_type="trigger-workflow" | |
service="the-push-service" | |
version="v0.0.3" | |
# Get the list of changed files from the previous step | |
changed_files="${{ steps.get_changes.outputs.files }}" | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.PAT }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \ | |
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"service\": \"$service\", \"version\": \"$version\", \"unit\": false, \"integration\": true, \"changed_files\": \"$changed_files\"}}" |