I'm currently testing GitHub Actions workflows on this repository. I'm trying to use this workflow:
on:
workflow_dispatch:
jobs:
job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
date > report.txt
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "generate or update report.txt file"
git push
to trigger this workflow:
on:
push:
paths:
- '**/report.txt'
pull_request:
paths:
- '**/report.txt'
jobs:
job:
runs-on: ubuntu-latest
steps:
- run: echo "Report .txt file has been updated"
I followed the GitHub Actions documentation to implement the second workflow with a filter pattern.
When I update the report.txt
file locally, then commit and push the code to the repository, the second workflow triggers.
However, I don't understand why the second workflow doesn't trigger when the first workflow is completed, even with the report.txt
file being updated on the default branch. Did I miss something on the first workflow to make it trigger the second, or should I add something on the second workflow to make it being triggered by the first one?
I know I could trigger the second workflow using other trigger event types (examples: repository_dispatch
or workflow_run
), but I'm trying to do it from a git push
command on another workflow.