Skip to content

fix: ensure proper handling of missing push token in mirror workflow #11

fix: ensure proper handling of missing push token in mirror workflow

fix: ensure proper handling of missing push token in mirror workflow #11

name: Mirror main to pcm-dpc
on:
push:
branches:
- push-to-pcm-dpc-test
jobs:
mirror:
name: Push to pcm-dpc/propagator
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Push main to downstream repository
env:
# TARGET_REPO: pcm-dpc/propagator.git
PUSH_TOKEN: ${{ secrets.PROPAGATOR_PUSH_TO_PCMDPC_REPO_TOKEN }}
run: |
set -euo pipefail
if [ -z "${PUSH_TOKEN}" ]; then
echo "Secret PROPAGATOR_PUSH_TO_PCMDPC_REPO_TOKEN is missing or empty"; exit 1
fi
git config user.name "pcmdpc"
git config user.email "[email protected]"
git remote add downstream "https://x-access-token:${PUSH_TOKEN}@github.com/pcm-dpc/propagator.git"