Spaces:
Paused
Paused
icebear0828 Claude Opus 4.6 commited on
Commit ·
20b98cc
1
Parent(s): 8ab512c
ci: trigger release via workflow_dispatch to fix GITHUB_TOKEN limitation
Browse filesGITHUB_TOKEN push events don't trigger downstream workflows. Instead of
relying on tag push to trigger release.yml, sync-electron now explicitly
calls `gh workflow run` with the tag name after pushing.
- release.yml: accept `inputs.tag` for workflow_dispatch, checkout + release by tag
- sync-electron.yml: add `gh workflow run release.yml` step after tag push
- Add `actions: write` permission for workflow dispatch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Files changed (2)
4 unmodified lines567891019 unmodified lines30313233343536 unmodified lines72737475767778798081821 unmodified line84858687888990919293949596979 unmodified lines1071081091101111124 unmodified linestags:- "v*"workflow_dispatch:permissions:contents: write19 unmodified linessteps:- name: Checkoutuses: actions/checkout@v4- name: Setup Node.jsuses: actions/setup-node@v436 unmodified linesrelease:needs: buildruns-on: ubuntu-latestif: startsWith(github.ref, 'refs/tags/v')steps:- name: Checkoutuses: actions/checkout@v4- name: Download all artifactsuses: actions/download-artifact@v41 unmodified linepath: artifactsmerge-multiple: true- name: Generate release notesid: notesrun: |PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | sed -n '2p')if [ -z "$PREV_TAG" ]; thenBODY="Initial release"elseBODY=$(git log "${PREV_TAG}..HEAD" --no-merges --pretty=format:"%s" \| grep -vE "^(chore|docs|ci)(\(.*\))?:" \| sed 's/^/- /')if [ -z "$BODY" ]; then9 unmodified lines- name: Create GitHub Releaseuses: softprops/action-gh-release@v2with:body: ${{ steps.notes.outputs.NOTES }}draft: falseprerelease: false4 unmodified lines5678910111213141519 unmodified lines353637383940414236 unmodified lines79808182838485868788899091921 unmodified line9495969798991001011021031041051061071081091101111121131149 unmodified lines1241251261271281291304 unmodified linestags:- "v*"workflow_dispatch:inputs:tag:description: "Tag to release (e.g. v1.0.11)"required: truetype: stringpermissions:contents: write19 unmodified linessteps:- name: Checkoutuses: actions/checkout@v4with:ref: ${{ inputs.tag || github.ref }}- name: Setup Node.jsuses: actions/setup-node@v436 unmodified linesrelease:needs: buildruns-on: ubuntu-latestif: startsWith(github.ref, 'refs/tags/v') || inputs.tagsteps:- name: Checkoutuses: actions/checkout@v4with:ref: ${{ inputs.tag || github.ref }}fetch-depth: 0- name: Download all artifactsuses: actions/download-artifact@v41 unmodified linepath: artifactsmerge-multiple: true- name: Resolve tagid: tagrun: |TAG="${{ inputs.tag || github.ref_name }}"echo "name=$TAG" >> "$GITHUB_OUTPUT"- name: Generate release notesid: notesrun: |TAG="${{ steps.tag.outputs.name }}"PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | grep -v "^${TAG}$" | head -1)if [ -z "$PREV_TAG" ]; thenBODY="Initial release"elseBODY=$(git log "${PREV_TAG}..${TAG}" --no-merges --pretty=format:"%s" \| grep -vE "^(chore|docs|ci)(\(.*\))?:" \| sed 's/^/- /')if [ -z "$BODY" ]; then9 unmodified lines- name: Create GitHub Releaseuses: softprops/action-gh-release@v2with:tag_name: ${{ steps.tag.outputs.name }}body: ${{ steps.notes.outputs.NOTES }}draft: falseprerelease: false
9 unmodified lines10111213141577 unmodified lines9394959697989 unmodified linescancel-in-progress: truepermissions:contents: writeissues: write77 unmodified linesgit push origin electronfi- name: Create issue on conflictif: env.CONFLICT == 'true'run: |9 unmodified lines1011121314151677 unmodified lines9495969798991001011021031041059 unmodified linescancel-in-progress: truepermissions:actions: writecontents: writeissues: write77 unmodified linesgit push origin electronfi- name: Trigger release workflowif: env.BUMP == 'true'run: gh workflow run release.yml -f tag="$NEW_TAG" --ref electronenv:GH_TOKEN: ${{ github.token }}- name: Create issue on conflictif: env.CONFLICT == 'true'run: |
.github/workflows/release.yml+21-3
.github/workflows/sync-electron.yml+7