File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 7979 host-version : ${{ steps.create-e2e-tests-input.outputs.host-version }}
8080 test-suite-version : ${{ steps.create-e2e-tests-input.outputs.test-suite-version }}
8181 steps :
82+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+ with :
84+ persist-credentials : ' false'
85+
8286 - id : create-e2e-tests-input
8387 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v0.8.0
8488 with :
8993 console.log(`New commit hash: ${newCommitHash}`)
9094 console.log(`Docker build results: ${process.env.DOCKER_BUILD_RESULTS}`)
9195
96+ const { execSync } = require('child_process');
9297 const dockerBuildResults = JSON.parse(process.env.DOCKER_BUILD_RESULTS);
9398 function getImageTagIfBuilt(key, build_result) {
94- let imageTag = dockerBuildResults[key].outputs[build_result] === 'success' ? newCommitHash : previousCommitHash;
99+ let imageCommit = dockerBuildResults[key].outputs[build_result] === 'success' ? newCommitHash : previousCommitHash;
100+ let imageTag;
101+ try {
102+ imageTag = execSync(`git rev-parse --short ${imageCommit}`, { encoding: 'utf8' }).trim();
103+ } catch (err) {
104+ console.log(`Failed to resolve short hash for ${imageCommit}, falling back to substring`);
105+ imageTag = imageCommit.substring(0, 7);
106+ }
95107 console.log(`Assigning image tag '${imageTag}' for ${key}`);
96108 return imageTag;
97109 }
You can’t perform that action at this time.
0 commit comments