Skip to content

Commit

Permalink
Add Github Action to mirror to public repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemalachowski committed Nov 14, 2024
1 parent d9a2291 commit 8b00cc1
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Mirror to Public Repository
on:
push:
branches: [ jake/gha-mirror ]

jobs:
mirror:
runs-on: ubuntu-latest
env:
ENABLE_MIRROR: ${{ secrets.ENABLE_MIRROR }}

steps:
- name: Checkout private repository
uses: actions/checkout@v4
if: ${{ env.ENABLE_MIRROR == 'true' }}
with:
# Must be set to avoid conflicting with the subsequent push
# https://github.com/ad-m/github-push-action/issues/44#issuecomment-581706892
fetch-depth: 0
persist-credentials: false

- name: Push to public repository
uses: ad-m/[email protected]
if: ${{ env.ENABLE_MIRROR == 'true' }}
with:
github_token: ${{ secrets.PUBLIC_REPO_TOKEN }}
repository: render-oss/cli
branch: jake/gha-mirror
force: true

0 comments on commit 8b00cc1

Please sign in to comment.