mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
ci(release): run channel publish after promote when GITHUB_TOKEN push skips push rules (#350)
GitHub does not fire push workflows for commits pushed with the default actions token. Chain Next/Release channel workflows from the matching promote workflow_run on success. Made-with: Cursor
This commit is contained in:
@@ -1,16 +1,23 @@
|
|||||||
name: Next Channel
|
name: Next Channel
|
||||||
|
|
||||||
|
# Pushes made with the default GITHUB_TOKEN from another workflow (e.g. Promote main to next)
|
||||||
|
# do not trigger push workflows — GitHub blocks recursive runs. Use workflow_run below.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [next]
|
branches: [next]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Promote main to next"]
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-next:
|
publish-next:
|
||||||
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
uses: ./.github/workflows/reusable-channel-publish.yml
|
uses: ./.github/workflows/reusable-channel-publish.yml
|
||||||
with:
|
with:
|
||||||
channel: next
|
channel: next
|
||||||
source_ref: ${{ github.ref_name }}
|
# workflow_run uses default-branch context; ref_name would be wrong — always build `next`
|
||||||
|
source_ref: ${{ github.event_name == 'workflow_run' && 'next' || github.ref_name }}
|
||||||
target_branch: next
|
target_branch: next
|
||||||
prerelease: true
|
prerelease: true
|
||||||
draft_release: false
|
draft_release: false
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
name: Release Channel
|
name: Release Channel
|
||||||
|
|
||||||
|
# Same GITHUB_TOKEN push limitation as Next Channel (see next.yml).
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [release]
|
branches: [release]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Promote next to release"]
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-release:
|
publish-release:
|
||||||
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
uses: ./.github/workflows/reusable-channel-publish.yml
|
uses: ./.github/workflows/reusable-channel-publish.yml
|
||||||
with:
|
with:
|
||||||
channel: release
|
channel: release
|
||||||
source_ref: ${{ github.ref_name }}
|
source_ref: ${{ github.event_name == 'workflow_run' && 'release' || github.ref_name }}
|
||||||
target_branch: release
|
target_branch: release
|
||||||
prerelease: false
|
prerelease: false
|
||||||
draft_release: true
|
draft_release: true
|
||||||
|
|||||||
Reference in New Issue
Block a user