Skip to content

Commit 9a2b4e9

Browse files
committed
fix(ci): refuse replacement of published release artifacts
1 parent 8dbbd3c commit 9a2b4e9

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ jobs:
8585
cp accepted/wrapped/*.cwl release-assets/wrapped/
8686
cd release-assets
8787
find . -type f -print0 | sort -z | xargs -0 sha256sum > SHA256SUMS
88+
- name: Refuse to replace any existing CWL artifact
89+
run: |
90+
printf '%s' "$GH_TOKEN" | oras login ghcr.io --username "$GITHUB_ACTOR" --password-stdin
91+
for cwl in release-assets/pattern-*.cwl release-assets/test-*.cwl; do
92+
name=$(basename "$cwl" .cwl)
93+
if oras resolve "ghcr.io/eoap/application-package-patterns/cwl/$name:$VERSION" >/dev/null 2>&1; then
94+
echo "Artifact already exists: $name:$VERSION"; exit 1
95+
fi
96+
done
97+
for cwl in release-assets/wrapped/*.cwl; do
98+
name=$(basename "$cwl" .cwl)
99+
if oras resolve "ghcr.io/eoap/application-package-patterns/cwl/$name-wrapped:$VERSION" >/dev/null 2>&1; then
100+
echo "Artifact already exists: $name-wrapped:$VERSION"; exit 1
101+
fi
102+
done
88103
- name: Publish standalone and wrapped CWL to GHCR
89104
run: |
90105
printf '%s' "$GH_TOKEN" | oras login ghcr.io --username "$GITHUB_ACTOR" --password-stdin

0 commit comments

Comments
 (0)