Skip to content

Commit 5890b37

Browse files
committed
fix(ci): bind mirror release commands to repo context
1 parent b24b05a commit 5890b37

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/release-desktop-multi-os.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ jobs:
7777
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7878
shell: bash
7979
run: |
80-
if gh release view "$GODOT_MIRROR_TAG" >/dev/null 2>&1; then
80+
if gh release view "$GODOT_MIRROR_TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
8181
echo "Godot mirror release already exists: $GODOT_MIRROR_TAG"
8282
else
8383
gh release create "$GODOT_MIRROR_TAG" \
84+
--repo "$GITHUB_REPOSITORY" \
8485
--target "$GITHUB_SHA" \
8586
--title "$GODOT_MIRROR_TAG" \
8687
--notes "Project-controlled mirror for Godot desktop bootstrap archives."
@@ -93,7 +94,7 @@ jobs:
9394
run: |
9495
set -euo pipefail
9596
mkdir -p build/godot-mirror
96-
mapfile -t EXISTING_ASSETS < <(gh release view "$GODOT_MIRROR_TAG" --json assets --jq '.assets[].name')
97+
mapfile -t EXISTING_ASSETS < <(gh release view "$GODOT_MIRROR_TAG" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name')
9798
9899
has_asset() {
99100
local needle="$1"
@@ -118,7 +119,7 @@ jobs:
118119
119120
ARCHIVE_PATH="build/godot-mirror/$ASSET_NAME"
120121
curl -fsSL "${GODOT_UPSTREAM_BASE_URL}/${ASSET_NAME}" -o "$ARCHIVE_PATH"
121-
gh release upload "$GODOT_MIRROR_TAG" "$ARCHIVE_PATH" --clobber
122+
gh release upload "$GODOT_MIRROR_TAG" "$ARCHIVE_PATH" --repo "$GITHUB_REPOSITORY" --clobber
122123
echo "Uploaded mirror asset: $ASSET_NAME"
123124
done
124125

src/release.godot.mirror.contract.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ describe('release workflow godot mirror contract', () => {
1515

1616
expect(workflow).toContain('GODOT_MIRROR_TAG: "godot-mirror-v4.3-stable"');
1717
expect(workflow).toContain('ensure-godot-mirror-assets:');
18+
expect(workflow).toContain('gh release view "$GODOT_MIRROR_TAG" --repo "$GITHUB_REPOSITORY"');
1819
expect(workflow).toContain('gh release create "$GODOT_MIRROR_TAG" \\');
20+
expect(workflow).toContain('--repo "$GITHUB_REPOSITORY" \\');
1921
expect(workflow).toContain('--target "$GITHUB_SHA" \\');
20-
expect(workflow).toContain('gh release upload "$GODOT_MIRROR_TAG"');
22+
expect(workflow).toContain('gh release upload "$GODOT_MIRROR_TAG" "$ARCHIVE_PATH" --repo "$GITHUB_REPOSITORY" --clobber');
2123
expect(workflow).toContain(
2224
'https://github.com/Jacobinwwey/NoteConnection/releases/download/${GODOT_MIRROR_TAG}'
2325
);

0 commit comments

Comments
 (0)