fix(ci): dispatch GoReleaser after release-please; allow Tests dispatch (#13)
GITHUB_TOKEN cannot trigger push:tags workflows, so Release never ran after release-please. Dispatch release.yml explicitly when a release is created. Add workflow_dispatch to Tests for on-demand main verification.
This commit is contained in:
committed by
GitHub
co-authored by
GitHub
parent
3b55de5b1d
commit
76067f65d0
@@ -9,6 +9,7 @@ permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
issues: write
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
@@ -23,6 +24,18 @@ jobs:
|
||||
manifest-file: .release-please-manifest.json
|
||||
token: ${{ secrets.RELEASE_PLEASE_TOKEN != '' && secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Tags/releases created with GITHUB_TOKEN do not trigger other workflows
|
||||
# (push:tags on Release.yml never fires). Dispatch GoReleaser explicitly.
|
||||
- name: Trigger GoReleaser
|
||||
if: ${{ steps.release.outputs.release_created == 'true' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ steps.release.outputs.tag_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "Dispatching Release workflow for $TAG"
|
||||
gh workflow run release.yml --repo "${{ github.repository }}" -f "tag=${TAG}"
|
||||
|
||||
outputs:
|
||||
release_created: ${{ steps.release.outputs.release_created }}
|
||||
tag_name: ${{ steps.release.outputs.tag_name }}
|
||||
|
||||
@@ -4,6 +4,7 @@ on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
Reference in New Issue
Block a user