Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/upstream-release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ jobs:
workflow_dispatch)
if [ -n "$DISPATCH_PR" ]; then
PR_NUMBER="$DISPATCH_PR"
HEAD_REF=$(gh pr view "$PR_NUMBER" --json headRefName --jq .headRefName)
AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login')
# --repo is required because this step runs before the
# actions/checkout below — gh otherwise looks for a
# local .git context and fails with "not a git repository".
HEAD_REF=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json headRefName --jq .headRefName)
AUTHOR=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json author --jq '.author.login')
case "$AUTHOR" in
app/renovate|renovate[bot]|app/github-actions|github-actions[bot])
;;
Expand Down Expand Up @@ -235,9 +238,10 @@ jobs:
BASE="$BASE_FROM_EVENT"
else
# workflow_dispatch retry: look up the PR's base_ref.
# --repo because in retry mode there's no prior checkout.
NUMBER="$PR_FROM_RESOLVE"
HEAD="$HEAD_FROM_RESOLVE"
BASE=$(gh pr view "$NUMBER" --json baseRefName --jq .baseRefName)
BASE=$(gh pr view "$NUMBER" --repo "$GITHUB_REPOSITORY" --json baseRefName --jq .baseRefName)
fi
{
echo "number=$NUMBER"
Expand Down Expand Up @@ -344,21 +348,26 @@ jobs:
node scripts/bundle-upstream-schema.mjs
rm -rf "$TMP"

# Commit the refreshed reference assets (synced release-asset
# files + regenerated toolhive CRD MDX if applicable) before the
# skill runs. This keeps the skill's content commit clean and
# Commit AND PUSH the refreshed reference assets (synced release-
# asset files + regenerated toolhive CRD MDX if applicable) before
# the skill runs. Pushing here — rather than batching the push
# with the skill-content commit later — means refresh work is
# preserved on the PR even if the skill step fails or is
# cancelled. Also keeps the skill's content commit clean and
# lets the autogen-detect step below distinguish skill touches
# from our own legitimate refresh writes.
- name: Commit refreshed reference assets
- name: Commit + push refreshed reference assets
env:
PROJECT_ID: ${{ steps.detect.outputs.id }}
NEW_TAG: ${{ steps.detect.outputs.new_tag }}
HEAD_REF: ${{ steps.eff.outputs.head_ref }}
run: |
git add -A
if git diff --cached --quiet; then
echo "No reference changes for $PROJECT_ID $NEW_TAG."
else
git commit -m "Refresh reference assets for $PROJECT_ID $NEW_TAG"
git push origin "HEAD:$HEAD_REF"
fi

- name: Extract reviewers from release compare
Expand Down