Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(ci): fetch main and tag the merged commit, not the local branch tip

EtienneLescot44d05c2f8077
diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml
index c5b2daa9e..97db47e85 100644
--- a/.github/workflows/prerelease.yml
+++ b/.github/workflows/prerelease.yml
@@ -125,7 +125,16 @@ jobs:
env:
TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }}
RC_TAG: ${{ steps.version.outputs.rc_tag }}
- run: git push "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$RC_TAG"
+ run: |
+ set -euo pipefail
+ # After gh pr merge --rebase, the bump commit is on origin/main. Refresh the
+ # local main and tag the resulting HEAD so the tag points at the merged commit.
+ git remote set-url origin "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
+ git fetch origin main
+ git checkout main
+ git reset --hard origin/main
+ git tag "$RC_TAG"
+ git push origin "$RC_TAG"
- name: Announce RC on Discord (#rc-testing)
if: success()
diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml
index e302dc056..d8a22dd5b 100644
--- a/.github/workflows/promote.yml
+++ b/.github/workflows/promote.yml
@@ -108,7 +108,14 @@ jobs:
env:
TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }}
STABLE_TAG: ${{ steps.version.outputs.stable_tag }}
- run: git push "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "$STABLE_TAG"
+ run: |
+ set -euo pipefail
+ git remote set-url origin "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
+ git fetch origin main
+ git checkout main
+ git reset --hard origin/main
+ git tag "$STABLE_TAG"
+ git push origin "$STABLE_TAG"
- name: Announce stable on Discord
if: success()