Skip to content

Commit

Permalink
Fix issue with failure()
Browse files Browse the repository at this point in the history
  • Loading branch information
jlantz committed Sep 6, 2024
1 parent 1002d5a commit 7d99c21
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/feature-test-2gp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ on:
required: false
default: false
type: boolean
# snapshot-fail:
# required: false
# default: false
# type: boolean
snapshot-fail:
required: false
default: false
type: boolean
snapshot-fail-pr:
required: false
default: false
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:

- name: Check for Apex Test Failure
id: check_apex_failure
if: ${{ failure() }}
if: ${{ job.status == 'failure' }}
run: |
if cci error info | grep -q "cumulusci.salesforce_api.exceptions.ApexTestException"; then
echo "Apex test failure detected"
Expand Down Expand Up @@ -176,10 +176,10 @@ jobs:
else
CREATE_SNAPSHOT="true"
fi
elif [[ "${{ inputs.snapshot-fail-test-only }}" == "true" && "${{ failure() }}" == "true" ]]; then
elif [[ "${{ inputs.snapshot-fail-test-only }}" == "true" && "${{ job.status == 'failure' }}" == "true" ]]; then
CREATE_SNAPSHOT="true"
fi
elif [[ "${{ inputs.snapshot-fail }}" == "true" && ("${{ steps.check_apex_failure.outputs.apex_failure }}" == "true" || ("${{ inputs.snapshot-fail-test-only }}" == "true" && "${{ failure() }}" == "true")) ]]; then
elif [[ "${{ inputs.snapshot-fail }}" == "true" && ("${{ steps.check_apex_failure.outputs.apex_failure }}" == "true" || ("${{ inputs.snapshot-fail-test-only }}" == "true" && "${{ job.status == 'failure' }}" == "true")) ]]; then
CREATE_SNAPSHOT="true"
fi
echo "create=$CREATE_SNAPSHOT" >> $GITHUB_OUTPUT
Expand All @@ -203,7 +203,7 @@ jobs:
# Image Name
if [[ "${{ steps.check_apex_failure.outputs.apex_failure }}" == "true" ]]; then
IMAGE_NAME="Ftests"
elif [[ "${{ failure() }}" == "true" ]]; then
elif [[ "${{ job.status == 'failure' }}" == "true" ]]; then
IMAGE_NAME="Fbuild"
# Truncate Image Name if necessary (leaving room for OrgTypeCode)
Expand Down

0 comments on commit 7d99c21

Please sign in to comment.