Skip to content

Commit 47f8241

Browse files
authored
Merge pull request #262 from vicentebolea/appveyor-cdash-commit
Fixes flaky cdash status
2 parents 9f065eb + 8228030 commit 47f8241

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/post-cdash-status

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eo pipefail
44

55
readonly API_BASE="https://api.github.com/repos/LLNL/zfp"
66
readonly TOKEN="${CI_GITHUB_ROBOT_TOKEN}"
7-
readonly COMMIT="${GITHUB_WORKFLOW_SHA}"
7+
readonly COMMIT="${COMMIT_SHA}"
88
readonly CDASH_STATUS_CONTEXT="cdash"
99

1010
#==============================================================================
@@ -26,7 +26,7 @@ command -v curl &> /dev/null || { echo "jq not found"; exit 1; }
2626
command -v jq &> /dev/null || { echo "jq not found"; exit 2; }
2727

2828
[ -z "${CI_GITHUB_ROBOT_TOKEN}" ] && { echo "CI_GITHUB_ROBOT_TOKEN env variable empty"; exit 3; }
29-
[ -z "${GITHUB_WORKFLOW_SHA}" ] && { echo "GITHUB_WORKFLOW_SHA env variable empty"; exit 4; }
29+
[ -z "${COMMIT_SHA}" ] && { echo "COMMIT_SHA env variable empty"; exit 4; }
3030

3131
#==============================================================================
3232

.github/workflows/external.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ permissions: write-all
77

88
jobs:
99
generate_statuses:
10+
env:
11+
CI_GITHUB_ROBOT_TOKEN: ${{ secrets.CI_GITHUB_ROBOT_TOKEN }}
1012
runs-on: ubuntu-latest
1113
steps:
1214
- uses: actions/checkout@v4
15+
- if: ${{ github.event_name == 'pull_request_target' }}
16+
run: echo "COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> "${GITHUB_ENV}"
17+
18+
- if: ${{ github.event_name == 'push' }}
19+
run: echo "COMMIT_SHA=${{ github.sha }}" >> "${GITHUB_ENV}"
20+
1321
- run: .github/post-cdash-status
14-
env:
15-
CI_GITHUB_ROBOT_TOKEN: ${{ secrets.CI_GITHUB_ROBOT_TOKEN }}

0 commit comments

Comments
 (0)