Skip to content

Fix "Generate API docs JSON" workflow failing on pull_request events - #291

Closed
star-e with Copilot wants to merge 2 commits into
v4.0.0from
copilot/fix-github-actions-job
Closed

Fix "Generate API docs JSON" workflow failing on pull_request events#291
star-e with Copilot wants to merge 2 commits into
v4.0.0from
copilot/fix-github-actions-job

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

On pull_request events, github.ref resolves to refs/pull/<N>/merge — a virtual ref that actions/checkout cannot fetch directly — causing the workflow to fail with fatal: couldn't find remote ref.

Changes

  • generate-api-docs.yml: Added a dedicated pull_request branch in the "Get ref" step that uses github.sha (the actual merge commit SHA) instead of github.ref, which is only valid for tag/branch push events.
- else
-   echo "Get ref from push"
-   echo "ENGINE_REF=${{ github.ref }}" >> $GITHUB_OUTPUT
+ elif [ "${{ github.event_name }}" = 'pull_request' ]; then
+   echo "Get ref from pull_request"
+   echo "ENGINE_REF=${{ github.sha }}" >> $GITHUB_OUTPUT
+ else
+   echo "Get ref from push"
+   echo "ENGINE_REF=${{ github.ref }}" >> $GITHUB_OUTPUT

…events

Co-authored-by: star-e <13654656+star-e@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Generate API docs JSON Fix "Generate API docs JSON" workflow failing on pull_request events Aug 17, 2026
@star-e
star-e marked this pull request as ready for review August 17, 2026 10:02
Copilot AI requested a review from star-e August 17, 2026 10:02
@star-e star-e closed this Sep 4, 2026
@star-e
star-e deleted the copilot/fix-github-actions-job branch September 4, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants