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 lines5678910111213141519 unmodified lines353637383940414236 unmodified lines7980817582838485868788899091921 unmodified line94959697989910010110210310410510690107108109110941111121131149 unmodified lines1241251261271281291304 unmodified lines tags: - "v*" workflow_dispatch: inputs: tag: description: "Tag to release (e.g. v1.0.11)" required: true type: string
permissions: contents: write19 unmodified lines steps: - name: Checkout uses: actions/checkout@v4 with: ref: ${{ inputs.tag || github.ref }}
- name: Setup Node.js uses: actions/setup-node@v436 unmodified lines release: needs: build runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v') || inputs.tag
steps: - name: Checkout uses: actions/checkout@v4 with: ref: ${{ inputs.tag || github.ref }} fetch-depth: 0
- name: Download all artifacts uses: actions/download-artifact@v41 unmodified line path: artifacts merge-multiple: true
- name: Resolve tag id: tag run: | TAG="${{ inputs.tag || github.ref_name }}" echo "name=$TAG" >> "$GITHUB_OUTPUT"
- name: Generate release notes id: notes run: | TAG="${{ steps.tag.outputs.name }}" PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | sed -n '2p') PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | grep -v "^${TAG}$" | head -1) if [ -z "$PREV_TAG" ]; then BODY="Initial release" else BODY=$(git log "${PREV_TAG}..HEAD" --no-merges --pretty=format:"%s" \ BODY=$(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 Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.tag.outputs.name }} body: ${{ steps.notes.outputs.NOTES }} draft: false prerelease: false9 unmodified lines1011121314151677 unmodified lines9495969798991001011021031041059 unmodified lines cancel-in-progress: true
permissions: actions: write contents: write issues: write
77 unmodified lines git push origin electron fi
- name: Trigger release workflow if: env.BUMP == 'true' run: gh workflow run release.yml -f tag="$NEW_TAG" --ref electron env: GH_TOKEN: ${{ github.token }}
- name: Create issue on conflict if: env.CONFLICT == 'true' run: |.github/workflows/release.yml+21-3
.github/workflows/sync-electron.yml+7