Skip to content

Update CV references and enhance hero section layout: Rename CV file … #14

Update CV references and enhance hero section layout: Rename CV file …

Update CV references and enhance hero section layout: Rename CV file … #14

Workflow file for this run

name: Sync Repositories
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sync-${{ github.repository }}-${{ github.ref }}
cancel-in-progress: false
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Resolve mirror repository
id: mirror
run: |
case "${{ github.repository }}" in
Bardakor/rust-portfolio)
echo "repo=Bardakor/bardakor.github.io" >> "$GITHUB_OUTPUT"
;;
Bardakor/bardakor.github.io)
echo "repo=Bardakor/rust-portfolio" >> "$GITHUB_OUTPUT"
;;
*)
echo "Unsupported repository: ${{ github.repository }}" >&2
exit 1
;;
esac
- name: Skip when mirror is already up to date
id: check
env:
GH_TOKEN: ${{ secrets.REPO_SYNC_TOKEN }}
MIRROR_REPO: ${{ steps.mirror.outputs.repo }}
run: |
if [ -z "$GH_TOKEN" ]; then
echo "::error::REPO_SYNC_TOKEN is not configured on this repository."
exit 1
fi
REMOTE_SHA=$(gh api "repos/${MIRROR_REPO}/commits/main" --jq .sha)
echo "local=${{ github.sha }}"
echo "remote=${REMOTE_SHA}"
if [ "$REMOTE_SHA" = "${{ github.sha }}" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "Mirror already matches this commit; skipping sync."
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Sync mirror repository
if: steps.check.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.REPO_SYNC_TOKEN }}
MIRROR_REPO: ${{ steps.mirror.outputs.repo }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add mirror "https://x-access-token:${GH_TOKEN}@github.com/${MIRROR_REPO}.git"
git push mirror "HEAD:main" --force