Skip to content
Snippets Groups Projects

Add Github workspace mirror.yml so we can pull to github daily

Closed Randy Fay requested to merge issue/drupalpod-3474581:20240915_mirror_on_github into main
1 file
+ 32
0
Compare changes
  • Side-by-side
  • Inline
+ 32
0
name: Mirror from Upstream
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Set up Git environment
run: |
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
- name: Clone upstream repository
run: |
git clone --mirror ${UPSTREAM_REPO} tempdir
- name: Push to GitHub
env:
UPSTREAM_REPO: ${{ vars.UPSTREAM_REPO }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
cd tempdir
git remote set-url --push origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${REPO}.git"
git push --mirror
Loading