allow for self-hosted tests

This commit is contained in:
crystal 2024-04-28 08:18:23 -06:00
parent cee5e87ae3
commit 6b780077a1
No known key found for this signature in database
GPG key ID: 1122054731F7CC43
2 changed files with 3 additions and 7 deletions

View file

@ -1,11 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ "$GITHUB_REPOSITORY_OWNER" = "crystal" ] ; then
echo "crystal_pr: skipping mirror!"
exit 0
fi
git fetch --tags git fetch --tags
git remote add action-forgejo-mirror https://forgejo-deb:$FORGEJO_KEY@$FORGEJO_DEST/$GITHUB_REPOSITORY git remote add action-forgejo-mirror https://action-forgejo-mirror:$FORGEJO_KEY@$FORGEJO_DEST/$GITHUB_REPOSITORY
git push action-forgejo-mirror --all git push action-forgejo-mirror --all
git push action-forgejo-mirror --tags "refs/remotes/origin/*:refs/heads/*" git push action-forgejo-mirror --tags "refs/remotes/origin/*:refs/heads/*"
git remote remove action-forgejo-mirror git remote remove action-forgejo-mirror

View file

@ -2,7 +2,7 @@ on: [push, pull_request]
jobs: jobs:
mirror: mirror:
runs-on: bookworm runs-on: bookworm
if: github.event_name == 'push' if: github.event_name == 'push' && github.repository == 'forgejo-contrib/forgejo-deb'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -193,7 +193,7 @@ jobs:
publish-release-repo: publish-release-repo:
runs-on: bookworm runs-on: bookworm
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.repository == 'forgejo-contrib/forgejo-deb'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4