Skip to content

Commit e227e8e

Browse files
author
manfredsteger
committed
Improve GitHub Actions by conditionally mirroring to GitLab
Adjust the GitHub Actions release workflow to conditionally mirror to GitLab based on the presence of a GitLab token, and move the conditional logic to the step level. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1117a91e-7ac6-4005-bde2-487c64d5789f Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 51c7d9fe-116b-45f8-88a3-276833367093 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/afc5b6d1-cfc6-4564-802f-661c3d73f96b/1117a91e-7ac6-4005-bde2-487c64d5789f/EPF6XUK
1 parent 90c6cb7 commit e227e8e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,19 @@ jobs:
196196
name: Mirror to GitLab
197197
runs-on: ubuntu-latest
198198
needs: github-release
199-
if: ${{ secrets.GITLAB_TOKEN != '' }}
200199
steps:
201200
- name: Checkout
202201
uses: actions/checkout@v4
202+
if: ${{ env.HAS_GITLAB_TOKEN == 'true' }}
203203
with:
204204
fetch-depth: 0
205205

206206
- name: Push to GitLab
207+
if: ${{ env.HAS_GITLAB_TOKEN == 'true' }}
207208
env:
208209
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
209210
run: |
210211
git remote add gitlab https://oauth2:${GITLAB_TOKEN}@projekte.services.kita.bayern/entwicklung/termine/polly.git 2>/dev/null || true
211212
git push gitlab ${GITHUB_REF} 2>/dev/null || echo "GitLab mirror push skipped (token not set or access denied)"
213+
env:
214+
HAS_GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN != '' }}

0 commit comments

Comments
 (0)