-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
# A reusable workflow that is used to detect whether code changes | ||
# are relevant for czishrink and/or czicompress. | ||
# See | ||
# - https://github.com/dorny/paths-filter#examples | ||
# - https://docs.github.com/en/actions/using-workflows/reusing-workflows | ||
name: subproject-changes | ||
|
||
# Required permissions | ||
permissions: | ||
pull-requests: read | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
czishrink: | ||
description: "'true' if the change affects czishrink or if github.event_name is not 'pull_request'; 'false' otherwise" | ||
value: ${{ jobs.detect_changes.outputs.czishrink }} | ||
czicompress: | ||
description: "'true' if the change affects czicompress or if github.event_name is not 'pull_request'; 'false' otherwise" | ||
value: ${{ jobs.detect_changes.outputs.czicompress }} | ||
|
||
jobs: | ||
# JOB to run change detection | ||
detect_changes: | ||
runs-on: ubuntu-latest | ||
# Set job outputs to values from filter step for PRs, and true for other events. | ||
outputs: | ||
czishrink: ${{ steps.result.outputs.czishrink }} | ||
czicompress: ${{ steps.result.outputs.czicompress }} | ||
steps: | ||
# For pull requests it's not necessary to checkout the code | ||
- uses: dorny/paths-filter@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
id: filter | ||
with: | ||
filters: | | ||
czishrink: | ||
- 'czishrink/**' | ||
- '.github/**' | ||
- '*.yml' | ||
czicompress: | ||
- '**czicompress**' | ||
- '.github/**' | ||
- '*.yml' | ||
- id: result | ||
run: | | ||
echo "czishrink=${{ github.event_name != 'pull_request' || steps.filter.outputs.czishrink == 'true' }}" | ||
echo "czicompress=${{ github.event_name != 'pull_request' || steps.filter.outputs.czicompress == 'true' }}" | ||
echo "czishrink=${{ github.event_name != 'pull_request' || steps.filter.outputs.czishrink == 'true' }}" >> "$GITHUB_OUTPUT" | ||
echo "czicompress=${{ github.event_name != 'pull_request' || steps.filter.outputs.czicompress == 'true' }}" >> "$GITHUB_OUTPUT" |