diff --git a/.github/workflows/release-skills.yml b/.github/workflows/release-skills.yml index 2ec98b0..aaf9319 100644 --- a/.github/workflows/release-skills.yml +++ b/.github/workflows/release-skills.yml @@ -58,29 +58,24 @@ jobs: output-file: "CHANGELOG.md" git-push: "false" - - name: Report validate-skills status on release commit + - name: Push release commit to main if: ${{ steps.changelog.outputs.skipped == 'false' }} env: GH_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} run: | SHA=$(git rev-parse HEAD) + TEMP_BRANCH="release-$(date +%s)" + # Push commit to a temp branch so the SHA exists on the remote + git push origin "$SHA:refs/heads/$TEMP_BRANCH" + # Report the required status check on the now-visible commit gh api "repos/${{ github.repository }}/statuses/$SHA" \ -f state=success \ -f context=validate-skills \ -f description="Validated in release workflow" - - - name: Verify tag does not already exist - if: ${{ steps.changelog.outputs.skipped == 'false' }} - run: | - TAG="${{ steps.changelog.outputs.tag }}" - if git ls-remote --tags origin | grep -q "refs/tags/$TAG$"; then - echo "::error::Tag $TAG already exists on remote. Delete it first if re-releasing: git push --delete origin $TAG" - exit 1 - fi - - - name: Push release commit and tag - if: ${{ steps.changelog.outputs.skipped == 'false' }} - run: git push origin main --follow-tags + # Push to main (status check is now satisfied) + git push origin main --follow-tags + # Clean up temp branch + git push origin --delete "$TEMP_BRANCH" || true - name: Create Github Release id: release