Skip to content
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

Make use of path filters for GitHub actions #29

Closed
FelixS90 opened this issue Nov 15, 2023 · 3 comments
Closed

Make use of path filters for GitHub actions #29

FelixS90 opened this issue Nov 15, 2023 · 3 comments

Comments

@FelixS90
Copy link
Collaborator

FelixS90 commented Nov 15, 2023

Is your feature request related to a problem? Please describe.
The following pipelines are currently triggered/running regardless whether there is a change justifying a run:

https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml
https://github.com/ZEISS/czicompress/actions/workflows/czishrink_dotnet.yml
https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml
https://github.com/ZEISS/czicompress/actions/workflows/czishrink_codeql.yml

Describe the solution you'd like
Make use of https://github.com/dorny/paths-filter to only run the pipelines listed above in case of changes in:

https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml
https://github.com/ZEISS/czicompress/actions/workflows/czicompress_codeql.yml
-> Change in czicompress or ./ excluding czishrink

https://github.com/ZEISS/czicompress/actions/workflows/czishrink_dotnet.yml
https://github.com/ZEISS/czicompress/actions/workflows/czishrink_codeql.yml
-> Change in czishrink or ./ excluding czicompress

Additional context
Add any other context or screenshots about the feature request here.
https://stackoverflow.com/questions/70708306/github-actions-run-step-job-in-a-workflow-if-changes-happen-in-specific-folde
https://github.com/orgs/community/discussions/25669
https://how.wtf/run-workflow-step-or-job-based-on-file-changes-github-actions.html

In particular, status checks will still work/apply:
https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

@m-ringler
Copy link
Contributor

m-ringler commented Nov 16, 2023

We had path filters initially in PR #6, but we removed them because the respective github workflows were required PR checks (via branch protection rules). E. g. when you make changes to czishrink, a successful czicompress_cmake build is still required to be able to complete a PR targeting main. So it would be required to 'path-filter' also the branch protection rules.

@FelixS90
Copy link
Collaborator Author

We had path filters initially in PR #6, but we removed them because the respective github workflows were required PR checks (via branch protection rules). E. g. when you make changes to czishrink, a successful czicompress_cmake build is still required to be able to complete a PR targeting main. So it would be required to 'path-filter' also the branch protection rules.

Thanks for your remark. Please refer to "Additional context" above. The workflow will not be skipped - the job will be skipped based on the outcome of https://github.com/dorny/paths-filter, i.e. it works on job/step level. Thus, individual jobs will be marked as skipped, which however makes the check pass/succeed.

@m-ringler
Copy link
Contributor

I've abandoned the PRs #36 and #37. Nobody seems to work on this any more and there is no real urgency => closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants