Skip to content

Commit

Permalink
feat: add GITHUB_RUN_ID in tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Dec 17, 2024
1 parent f2c8aa1 commit d427629
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export function getDockerTags({
tags.add(makeDockerTag(['latest', ...tagChunks]));
console.log('MAKE', makeDockerTag(['latest', ...tagChunks]));
}
if (process.env.GITHUB_RUN_ID) {
tags.add(makeDockerTag([`GHA-${process.env.GITHUB_RUN_ID}`]));
}


Check failure on line 72 in src/docker.js

View workflow job for this annotation

GitHub Actions / build

More than 1 blank line not allowed
return [...tags];
}
Expand Down
3 changes: 2 additions & 1 deletion src/docker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jest.mock('./github.js', () => jest.fn().mockImplementation(() => NEW_REL));
beforeEach(() => {
process.env.TEST_ENV = 'true';
process.env.DOCKERHUB_TOKEN = 'dummy';
process.env.GITHUB_RUN_ID= '123';

Check failure on line 15 in src/docker.test.js

View workflow job for this annotation

GitHub Actions / build

Operator '=' must be spaced
});

afterEach(() => {
Expand Down Expand Up @@ -68,7 +69,7 @@ describe('getDockerTags', () => {
'pull_request',
PR_ID,
false,
[`${REPO}:22e7c60-dev`, `${REPO}:${SHA}-dev`, `${REPO}:pr-${PR_ID}-dev`],
[`${REPO}:22e7c60-dev`, `${REPO}:${SHA}-dev`, `${REPO}:pr-${PR_ID}-dev`, `${REPO}:GHA-123`],
],
// old releases
[
Expand Down

0 comments on commit d427629

Please sign in to comment.