Skip to content

Commit 3ec22a2

Browse files
author
Dave Kozma
authored
Fix release action (#57)
1 parent cd2c2a7 commit 3ec22a2

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.changeset/cyan-zoos-complain.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"c2pa-node": patch
3+
---
4+
5+
Fix release action

.github/workflows/release.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,21 @@ jobs:
149149
path: generated/${{ steps.package-artifact.outputs.archive }}
150150
retention-days: 3
151151

152+
- id: get-release-id
153+
shell: bash
154+
env:
155+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156+
run: |
157+
echo "id=$(curl -s -L \
158+
-H 'Accept: application/vnd.github+json' \
159+
-H 'Authorization: Bearer ${{ env.GITHUB_TOKEN }}' \
160+
-H 'X-GitHub-Api-Version: 2022-11-28' \
161+
https://api.github.com/repos/${{ github.repository }}/releases/tags/v${{ env.PUBLISHED_VERSION }} | jq '.id')" >> "$GITHUB_OUTPUT"
162+
152163
- name: Upload release asset
153164
if: needs.release.outputs.published == 'true'
154165
shell: bash
155166
env:
156-
OWNER: dkozma
157-
REPO: c2pa-node
158167
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159168
run: |
160169
curl -L \
@@ -163,5 +172,5 @@ jobs:
163172
-H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" \
164173
-H "X-GitHub-Api-Version: 2022-11-28" \
165174
-H "Content-Type: application/zip" \
166-
"https://uploads.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/releases/${{ env.PUBLISHED_VERSION }}/assets?name=${{ steps.package-artifact.outputs.archive }}" \
175+
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get-release-id.outputs.id }}/assets?name=${{ steps.package-artifact.outputs.archive }}" \
167176
--data-binary "@generated/${{ steps.package-artifact.outputs.archive }}"

0 commit comments

Comments
 (0)