Skip to content

Commit

Permalink
job one fail step one, pass step two, job two not on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicfraser committed Jan 24, 2024
1 parent 08c8cd8 commit 6a35054
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,23 @@ env:
IS_NAMED_BRANCH: ${{ github.ref == 'refs/heads/test_changed_files_action' }}

jobs:
call-workflow:
uses: ./.github/workflows/callable.yml
# call-workflow:
# uses: ./.github/workflows/callable.yml

one:
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: [call-workflow]
runs-on: ubuntu-latest
steps:
# - name: Step 1
# id: step-one
# run: exit -1
- name: Step 1
id: step-one
run: exit -1

- name: Print status
run: echo "${{ steps.call-workflow.result }} - ${{ needs.call-workflow.result }}"
# - name: Print status
# run: echo "${{ steps.call-workflow.result }} - ${{ needs.call-workflow.result }}"

- name: Print hello if success
if: steps.call-workflow.result == 'success'
run: echo "success"

- name: Print hello if skipped
if: steps.call-workflow.result == 'skipped'
- name: Print hello
if: ${{ always() }}
run: echo "skipped"

# - name: No files in matcher have been modified
Expand All @@ -46,14 +42,14 @@ jobs:
# echo "One or more test file(s) has changed."
# echo "List all the files that have changed: ${{ steps.changed-files.outputs.all_modified_files }}"

# two:
# # if: ${{ always() && !failure() && !cancelled() }}
# if: ${{ always() && !failure() }}
# needs: [one]
# runs-on: ubuntu-latest
# steps:
# - name: Runs
# run: echo "runs"
two:
# if: ${{ always() && !failure() && !cancelled() }}
if: ${{ always() && !failure() }}
needs: [one]
runs-on: ubuntu-latest
steps:
- name: Runs
run: echo "runs"



0 comments on commit 6a35054

Please sign in to comment.