Skip to content

Commit fdfbd50

Browse files
authored
Merge pull request #12 from stacknil/codex/sbom-diff-risk-v040x-release-automation
[codex] Harden sbom-diff-and-risk release asset automation
2 parents ab6e630 + dfd74f9 commit fdfbd50

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/sbom-diff-and-risk-ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ jobs:
118118
steps:
119119
- name: Check out repository
120120
uses: actions/checkout@v5
121+
with:
122+
fetch-depth: 0
121123

122124
- name: Download built distribution artifact
123125
uses: actions/download-artifact@v4
@@ -129,6 +131,7 @@ jobs:
129131
shell: bash
130132
env:
131133
GH_TOKEN: ${{ github.token }}
134+
GH_REPO: ${{ github.repository }}
132135
RELEASE_TAG: ${{ github.ref_name }}
133136
RELEASE_TITLE_PREFIX: ${{ env.SBOM_DIFF_RISK_RELEASE_TITLE_PREFIX }}
134137
run: |
@@ -142,19 +145,20 @@ jobs:
142145
143146
title="${RELEASE_TITLE_PREFIX} ${RELEASE_TAG}"
144147
145-
if gh release view "${RELEASE_TAG}" >/dev/null 2>&1; then
146-
is_draft="$(gh release view "${RELEASE_TAG}" --json isDraft -q .isDraft)"
148+
if gh release view "${RELEASE_TAG}" --repo "${GH_REPO}" >/dev/null 2>&1; then
149+
is_draft="$(gh release view "${RELEASE_TAG}" --repo "${GH_REPO}" --json isDraft -q .isDraft)"
147150
if [ "${is_draft}" != "true" ]; then
148151
echo "Release ${RELEASE_TAG} already exists and is published; leaving assets unchanged."
149152
exit 0
150153
fi
151154
else
152155
gh release create "${RELEASE_TAG}" \
156+
--repo "${GH_REPO}" \
153157
--draft \
154158
--verify-tag \
155159
--title "${title}" \
156160
--notes "Release assets for ${RELEASE_TAG}. See docs/release-provenance.md for provenance verification guidance."
157161
fi
158162
159-
gh release upload "${RELEASE_TAG}" "${assets[@]}" --clobber
160-
gh release edit "${RELEASE_TAG}" --draft=false --title "${title}"
163+
gh release upload "${RELEASE_TAG}" "${assets[@]}" --repo "${GH_REPO}" --clobber
164+
gh release edit "${RELEASE_TAG}" --repo "${GH_REPO}" --draft=false --title "${title}"

0 commit comments

Comments
 (0)