Skip to content

Commit

Permalink
fix: don't run sync workflow on downstream repos
Browse files Browse the repository at this point in the history
Also remove duplication with matrix strategy
  • Loading branch information
alexeagle authored Jan 14, 2025
1 parent 3a12238 commit fb2297c
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/sync_mirrors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,23 @@ on:
push:
branches: ['main']
jobs:
push-cci:
sync:
if: github.repository == 'aspect-build/bazel-examples'
strategy:
matrix:
dest: ["cci", "gha"]
runs-on: ubuntu-latest
steps:
- name: Get a full history so all commits are present
uses: actions/checkout@v4
with:
path: fresh-clone
fetch-depth: 0
- working-directory: fresh-clone
- name: Setup credentials
run: |
eval $(ssh-agent -s)
ssh-add - <<< '${{ secrets.BAZEL_EXAMPLES_CCI_DEPLOY_TOKEN }}'
git push git@github.com:aspect-build/bazel-examples-cci.git HEAD:main
push-gha:
runs-on: ubuntu-latest
steps:
- name: Get a full history so all commits are present
uses: actions/checkout@v4
with:
path: fresh-clone
fetch-depth: 0
- working-directory: fresh-clone
run: |
eval $(ssh-agent -s)
ssh-add - <<< '${{ secrets.BAZEL_EXAMPLES_GHA_DEPLOY_TOKEN }}'
git push git@github.com:aspect-build/bazel-examples-gha.git HEAD:main
- name: Push commits
working-directory: fresh-clone
run: git push git@github.com:aspect-build/bazel-examples-${{ matrix.dest }}.git HEAD:main

0 comments on commit fb2297c

Please sign in to comment.