Skip to content

Commit e5a7a63

Browse files
committed
🔧 chore(workflow): update RUN_RELEASE logic to conditionally execute semantic-release
1 parent e60ef56 commit e5a7a63

2 files changed

Lines changed: 14 additions & 49 deletions

File tree

‎.github/workflows/call-ci-semantic-release-sync.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ env:
44
RUN_TEST: 0
55
RUN_BUILD: 0
66
RUN_LINT: 0
7+
RUN_RELEASE: 1
78

89
on:
910
workflow_dispatch:
@@ -21,7 +22,7 @@ on:
2122
- 'renovate/**'
2223
- 'chore/**'
2324
- 'test/**'
24-
25+
2526
pull_request:
2627
branches:
2728
- main
@@ -44,4 +45,9 @@ jobs:
4445
# uses: variablesoftware/github-workflows/.github/workflows/ci-semantic-release-sync.yml@38038641148ab8eaa7c9be80d9041a6c8c80641e
4546
# No secrets block needed for GITHUB_TOKEN
4647
# No additional changes required
48+
with:
49+
RUN_LINT: 0
50+
RUN_BUILD: 0
51+
RUN_TEST: 0
52+
RUN_RELEASE: ${{ inputs.RUN_RELEASE || '1' }}
4753

‎.github/workflows/ci-semantic-release-sync.yml‎

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ jobs:
118118
which pnpm
119119
env | grep -E 'PNPM|NPM|NODE|PATH'
120120
- run: pnpm install --frozen-lockfile
121-
- run: pnpm semantic-release
121+
- run: |
122+
if [ "${{ inputs.RUN_RELEASE }}" = "1" ]; then
123+
pnpm semantic-release
124+
else
125+
echo "Skipping semantic-release because RUN_RELEASE != 1"
126+
fi
122127
env:
123128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124129
SCOPE: ${{ secrets.scope }}
@@ -127,50 +132,4 @@ jobs:
127132
RUN_TEST: ${{ inputs.RUN_TEST }}
128133
RUN_BUILD: ${{ inputs.RUN_BUILD }}
129134
RUN_LINT: ${{ inputs.RUN_LINT }}
130-
131-
# sync-stage-with-main:
132-
# name: Sync Stage with Main (after release)
133-
# needs: release
134-
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
135-
# runs-on: ubuntu-latest
136-
# permissions:
137-
# contents: write
138-
# pull-requests: write
139-
# steps:
140-
# - name: Checkout all branches
141-
# uses: actions/checkout@v4
142-
# with:
143-
# fetch-depth: 0
144-
# token: ${{ secrets.GITHUB_TOKEN }}
145-
# - name: Set up Git user
146-
# run: |
147-
# git config user.name "github-actions[bot]"
148-
# git config user.email "github-actions[bot]@users.noreply.github.com"
149-
# - name: Fetch all branches
150-
# run: |
151-
# git fetch origin main
152-
# git fetch origin stage
153-
# - name: Check if stage can be fast-forwarded to main
154-
# id: ffcheck
155-
# run: |
156-
# git checkout stage
157-
# if git merge-base --is-ancestor stage main; then
158-
# echo "can_ff=true" >> $GITHUB_OUTPUT
159-
# else
160-
# echo "can_ff=false" >> $GITHUB_OUTPUT
161-
# fi
162-
# - name: Fast-forward stage to main (if possible)
163-
# if: steps.ffcheck.outputs.can_ff == 'true'
164-
# run: |
165-
# git checkout stage
166-
# git merge --ff-only main
167-
# git push origin stage
168-
# - name: Create PR from main to stage (if fast-forward not possible)
169-
# if: steps.ffcheck.outputs.can_ff == 'false'
170-
# uses: repo-sync/pull-request@v2
171-
# with:
172-
# source_branch: main
173-
# destination_branch: stage
174-
# pr_title: "chore: sync stage with main after release"
175-
# pr_body: "Automated PR to sync stage with main after a semantic-release bump."
176-
# github_token: ${{ secrets.GITHUB_TOKEN }}
135+
RUN_RELEASE: ${{ inputs.RUN_RELEASE }}

0 commit comments

Comments
 (0)