-
Notifications
You must be signed in to change notification settings - Fork 19
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
Added paths filter to GitHub actions #204
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fake approval to see what happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another fake approval to test things now that develop has been merged in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the review spam while I was testing the effects of this PR.
In its current state, it prevents merging of approved PRs as the required actions have not completed.
I think what you'll want to do is something like this (pseudo code)
step:
Name: Succeed early if files are not modified
run: |
if ( no_relevant_file_modified() ) {
finish_action_with_success();
}
I'm not sure if that is possible though, it's something you'll need to check in the docs.
@peterwilsoncc we can handle this by adding a generic workflow that ignores the path we added to the actual workflow So, it will run instead of the actual workflow and we can satisfy the I have created and added that workflow for PHPCS(c4d298d) and it works as expected. what do you think about this approach? If you think adding an additional dummy workflow for each required workflow is additional overhead then we might add path filters only on heavy workflows like E2E tests OR maybe adjust required workflow settings. Thanks |
Thank @iamdharmesh -- that looks like a really nice approach. It does require repeating the paths in two files, so would need comments to alert people to change them in both locations. You could use a constant but I think that for two instances that would be over-engineering. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a minor nitpick inline.
I tested the changes with #209 to ensure that the tests run and fail as expected when needed.
Co-authored-by: Peter Wilson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM.
Description of the Change
This PR adds a paths filter in GitHub action workflows to run it only on specific file extensions. For example, This PR doesn't contain any PHP, JS, or CSS file changes. So, the related workflows(E2E tests, PHPUnit, PHPCS, PHP Compatibility, and ESLint) will not be run against this PR.
Closes #203
How to test the Change
See GitHub Actions check on this PR, E2E tests, PHPUnit, PHPCS, PHP Compatibility, and ESLint check should not run on this PR as we made changes in workflow files only.
Changelog Entry
Credits
Props @iamdharmesh
Checklist: