Skip to content

Commit 12b2a8d

Browse files
committed
ci: improve tests to pass with push tag event
Signed-off-by: Emilien Escalle <[email protected]>
1 parent e44dc00 commit 12b2a8d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/__test-action-docker-build-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
expectedTags.push(refTag);
124124
expectedImageVersion = refTag;
125125
126-
if (`${{ github.event_name }}` !== "workflow_dispatch") {
126+
if (`${{ github.event_name }}` === "push" && refTag === "${{ github.event.repository.default_branch }}") {
127127
expectedTags.push("latest");
128128
}
129129
}

.github/workflows/__test-action-docker-prune-pull-requests-image-tags.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ env:
1616
IMAGE_NAME: "test-prune-${{ github.run_number }}"
1717
PACKAGES: |
1818
ci-github-container/test-prune-${{ github.run_number }}
19-
${{ github.event_name != 'workflow_dispatch' && format('ci-github-container/test-prune-{0}/cache', github.run_number) || '' }}
19+
${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref_name != github.event.repository.default_branch)
20+
&& ''
21+
|| format('ci-github-container/test-prune-{0}/cache', github.run_number)
22+
}}
2023
2124
jobs:
2225
setup:

.github/workflows/__test-action-get-image-metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
expectedTags.push(prShaTag, prTag);
8888
} else {
8989
expectedTags.push("main");
90-
if (`${{ github.event_name }}` !== "workflow_dispatch") {
90+
if (`${{ github.event_name }}` === "push" && refTag === "${{ github.event.repository.default_branch }}") {
9191
expectedTags.push("latest");
9292
}
9393
}

0 commit comments

Comments
 (0)