Skip to content

Commit

Permalink
eng-218/not trigger on push (#27)
Browse files Browse the repository at this point in the history
* Set CI_TRIGGER default to false in CircleCI config

* Add repo check for dashboard-runner workflow
  • Loading branch information
jlmonroy13 authored Oct 17, 2024
1 parent 759d3ac commit 1f5cc9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ parameters:
default: "github"
CI_TRIGGER:
type: boolean
default: true
default: false


jobs:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/mirror-private-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Ensure repository is dashboard-runner
run: |
REPO_NAME=$(basename -s .git `git config --get remote.origin.url`)
if [ "$REPO_NAME" != "dashboard-runner" ]; then
echo "This action is only allowed to run in the earthfast/dashboard-runner repository."
exit 0
fi
- name: Push to private repository
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
Expand All @@ -32,13 +40,6 @@ jobs:
exit 1
fi
# Ensure this is only run in the dashboard-runner repository
REPO_NAME=$(basename -s .git `git config --get remote.origin.url`)
if [ "$REPO_NAME" != "dashboard-runner" ]; then
echo "This action is only allowed to run in the dashboard-runner repository."
exit 0
fi
# Clone the source repository
git clone --mirror https://${GH_TOKEN}@github.com/earthfast/dashboard-runner.git source-repo
cd source-repo
Expand All @@ -49,4 +50,4 @@ jobs:
# Push tags to the private repository
git push --prune https://${GH_TOKEN}@github.com/${TARGET_PRIVATE_MIRROR_REPO}.git +refs/tags/*:refs/tags/*
echo "Repository mirrored successfully!"
echo "Repository mirrored successfully!"

0 comments on commit 1f5cc9f

Please sign in to comment.