@@ -3,6 +3,8 @@ name: CLI Release Staging
33on :
44 pull_request :
55 branches : ['main']
6+ push :
7+ branches : ['**']
68
79concurrency :
810 group : cli-staging-release
@@ -14,14 +16,16 @@ permissions:
1416jobs :
1517 prepare-and-commit-staging :
1618 runs-on : ubuntu-latest
17- if : contains(github.event.pull_request.title, '[codecane]')
19+ if : |
20+ (github.event_name == 'pull_request' && contains(github.event.pull_request.title, '[codecane]')) ||
21+ (github.event_name == 'push' && contains(github.event.head_commit.message, '[codecane]'))
1822 outputs :
1923 new_version : ${{ steps.bump_version.outputs.new_version }}
2024 steps :
2125 - uses : actions/checkout@v4
2226 with :
2327 token : ${{ secrets.GITHUB_TOKEN }}
24- ref : ${{ github.event.pull_request.head.sha }}
28+ ref : ${{ github.event_name == 'pull_request' && github. event.pull_request.head.sha || github .sha }}
2529
2630 - name : Set up Bun
2731 uses : oven-sh/setup-bun@v2
@@ -135,7 +139,7 @@ jobs:
135139 binary-name : codecane
136140 new-version : ${{ needs.prepare-and-commit-staging.outputs.new_version }}
137141 artifact-name : cli-staging-metadata
138- checkout-ref : ${{ github.event.pull_request.head.sha }}
142+ checkout-ref : ${{ github.event_name == 'pull_request' && github. event.pull_request.head.sha || github .sha }}
139143 env-overrides : ' {}'
140144 secrets : inherit
141145
@@ -145,7 +149,7 @@ jobs:
145149 steps :
146150 - uses : actions/checkout@v4
147151 with :
148- ref : ${{ github.event.pull_request.head.sha }}
152+ ref : ${{ github.event_name == 'pull_request' && github. event.pull_request.head.sha || github .sha }}
149153
150154 - name : Clean up old CLI prereleases
151155 run : |
@@ -252,7 +256,7 @@ jobs:
252256 steps :
253257 - uses : actions/checkout@v4
254258 with :
255- ref : ${{ github.event.pull_request.head.sha }}
259+ ref : ${{ github.event_name == 'pull_request' && github. event.pull_request.head.sha || github .sha }}
256260
257261 - name : Download CLI staging package
258262 uses : actions/download-artifact@v4
0 commit comments