-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Ability to run a workflow if and only if certain file/directory changes #124
Comments
Have you tried ?? steps:
- uses: actions/checkout@v2
- name: Get changed files for dev
id: changed-files
uses: tj-actions/changed-files@v8.4
with:
files: |
dev
- uses: hmarr/auto-approve-action@v2
if: steps.changed-files-dev.outputs.any_changed == 'true'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}" |
Yeh so that does work, but if i have a file that's not under dev it'll also approve it. I was hoping to get an if in these files, and no others. |
I doubt that the step would still run for other files but I’m guessing your requesting that if other files and the dev folder change you don’t want to approve the PR just for only the dev folder changes ? |
Yeh that was the idea. However I. did this combined with CODEOWNERS PR restrictions for all files except dev, and that seems to work. |
I'll look into adding support for this. Glad you found a way around the issue. |
Is your feature request related to a problem? Please describe.
Use case:
I want to run a workflow if and only if any file under a certain directory changes.
If any other files have changed I do not want to run the workflow.
In my case, I'm trying to auto-approve a PR using this action https://github.com/marketplace/actions/auto-approve
but only if files under the
dev
directory have been updated, and nothing else.Describe the solution you'd like?
Ideally something like this:
Where
only_changed
would be true if any file in that directory were present, and ONLY files in that directory were in the diff (i.e no other files)Describe alternatives you've considered?
I've tried something like this:
But that doesn't seem to work and feels clunky.
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: