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
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ on:
type: string
default: ""

# actions:write — allow gh workflow run when PR checks must be triggered without a PAT
permissions:
contents: write
pull-requests: write
actions: write

jobs:
normalize:
Expand Down Expand Up @@ -66,10 +68,14 @@ jobs:
with:
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 0
# Optional: fine-grained or classic PAT with repo scope. Without it, GitHub suppresses
# pull_request workflows for pushes/PRs done with GITHUB_TOKEN — required checks stay pending.
token: ${{ secrets.WORKFLOW_TRIGGER_TOKEN != '' && secrets.WORKFLOW_TRIGGER_TOKEN || github.token }}

- name: Bump manifest, push release branch, publish release, open PR
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.WORKFLOW_TRIGGER_TOKEN != '' && secrets.WORKFLOW_TRIGGER_TOKEN || github.token }}
HAS_WORKFLOW_PAT: ${{ secrets.WORKFLOW_TRIGGER_TOKEN != '' }}
VERSION: ${{ needs.normalize.outputs.version }}
TAG: ${{ needs.normalize.outputs.tag }}
BRANCH: ${{ needs.normalize.outputs.branch }}
Expand Down Expand Up @@ -147,6 +153,13 @@ jobs:
echo "::notice::An open PR already exists for \`${BRANCH}\`; skipping \`gh pr create\`."
fi

# Without a PAT, GitHub does not run other workflows for this push/PR. Dispatch Validate
# on the release branch so hassfest/HACS run and show on the PR (same commit as head).
if [ "${HAS_WORKFLOW_PAT}" != "true" ]; then
echo "::notice::No WORKFLOW_TRIGGER_TOKEN — triggering Validate on \`${BRANCH}\` so PR checks are not stuck."
gh workflow run validate.yaml --ref "$BRANCH"
fi

- name: Summary
if: success()
env:
Expand All @@ -161,4 +174,7 @@ jobs:
echo "If \`${DEFAULT_BRANCH}\` still shows the old version, open **Pull requests** and merge the PR titled **Merge ${TAG} manifest bump**."
echo ""
echo "**Draft releases** use a temporary \`untagged-…\` URL in the job log until you **Publish** the release on GitHub; then the normal \`/releases/tag/${TAG}\` link applies."
echo ""
echo "### PR checks"
echo "If required checks were stuck: GitHub often **does not run** \`pull_request\` workflows for commits pushed with the default \`GITHUB_TOKEN\`. This workflow **dispatches Validate** on the release branch when secret \`WORKFLOW_TRIGGER_TOKEN\` is unset. Optionally add that repo secret (PAT with **contents** + **pull requests**, and **actions** if you use fine-grained) so push/PR use a non-GitHub Actions identity and checks start automatically like a normal PR."
} >> "$GITHUB_STEP_SUMMARY"
Loading