File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 5959 - test-suite-docker-build
6060 if : ${{ success() || failure() }}
6161 env :
62- COMMIT_HASH : ${{ github.event.pull_request.head.sha || github.sha }}
62+ PREVIOUS_COMMIT_HASH : ${{ github.event.pull_request.base.sha }}
63+ NEW_COMMIT_HASH : ${{ github.event.pull_request.head.sha }}
6364 DOCKER_BUILD_RESULTS : ${{ toJSON(needs) }}
6465 runs-on : ubuntu-latest
6566 outputs :
@@ -73,13 +74,15 @@ jobs:
7374 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v0.8.0
7475 with :
7576 script : |
76- const commitHash = process.env.COMMIT_HASH;
77- console.log(`Commit hash: ${commitHash}`)
77+ const previousCommitHash = process.env.PREVIOUS_COMMIT_HASH;
78+ const newCommitHash = process.env.NEW_COMMIT_HASH;
79+ console.log(`Previous commit hash: ${previousCommitHash}`)
80+ console.log(`New commit hash: ${newCommitHash}`)
7881 console.log(`Docker build results: ${process.env.DOCKER_BUILD_RESULTS}`)
7982
8083 const dockerBuildResults = JSON.parse(process.env.DOCKER_BUILD_RESULTS);
8184 function getImageTagIfBuilt(key, build_result) {
82- let imageTag = dockerBuildResults[key].outputs[build_result] === 'success' ? commitHash : '' ;
85+ let imageTag = dockerBuildResults[key].outputs[build_result] === 'success' ? newCommitHash : previousCommitHash ;
8386 console.log(`Assigning image tag '${imageTag}' for ${key}`);
8487 return imageTag;
8588 }
You can’t perform that action at this time.
0 commit comments