Soren Jensen
08/15/2023, 9:39 PMrequired-test:
name: required-test
runs-on: ubuntu-latest
environment: production
strategy:
fail-fast: false
matrix:
python-version: [ '3.11' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if any files changed
id: changed-files
uses: tj-actions/changed-files@v37
with:
files: |
.github/workflows/test_project2.yml
test_project2/**
- name: Run step if no files changed
if: steps.changed-files.outputs.any_changed == 'false'
run: |
echo "No relevant files changed. Return success"
exit 0
- name: Test
run: |
echo "test"
But even with the exit 0 the step Test is run and depending jobs also run. How do I exit the full workflow here?Pawel Rein
08/16/2023, 9:14 AMexit 1? with exit code 0 it's a success and the workflow continues. That however fails the run and you may not want that. At the price of duplication if there's more steps to follow, you can include the condition to every step
if: steps.changed-files.outputs.any_changed == 'true'
I guess this is the very thing you wanted to avoidPawel Rein
08/16/2023, 9:15 AMSoren Jensen
08/16/2023, 12:05 PMPawel Rein
08/16/2023, 2:06 PMGabriela Campana (Cloud Posse)
08/24/2023, 2:29 PMDan Miller (Cloud Posse)
08/24/2023, 6:12 PMtj-actions/changed-files , but we do something similiar with Atmos and the github-action-atmos-affected-stacks actionPawel Rein
08/25/2023, 8:02 AM