Created
May 18, 2022 21:51
-
-
Save ali-kamalizade/8b7500596ebc3db59378d057e9fa2e31 to your computer and use it in GitHub Desktop.
A sample GitHub workflow using paths filters that can be referenced on the step and job level (e.g. to skip a job if there were no related code changes)
This file contains hidden or 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
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
name: Check changes | |
outputs: | |
functions: ${{ steps.filter.outputs.functions }} | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout project to determine changed files | |
with: | |
fetch-depth: 50 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
base: main | |
filters: | | |
functions: | |
- 'functions/**/*' | |
- 'package.json' | |
functions: | |
runs-on: ubuntu-latest | |
name: Functions CI | |
needs: [changes] | |
# run job if there were actual changes | |
if: ${{ needs.changes.outputs.functions == 'true' }} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment