File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 - uses : pre-commit/action@v1.0.1
2626
2727 build-test-push :
28- if : github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
28+ if : github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || github.event_name == 'pull_request'
2929 runs-on : ubuntu-latest
3030 needs : pre-commit
3131 permissions :
6262 # Github does not allow evaluating a secret in an if condition, so we need to set them as environment variables
6363 DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
6464 DOCKERHUB_LOGIN : ${{ secrets.DOCKERHUB_LOGIN }}
65+ BOT_TOKEN : ${{ secrets.BOT_TOKEN }}
66+ BOT_LOGIN : ${{ secrets.BOT_LOGIN }}
6567 steps :
6668 # Image repo names have to be lowercase.
6769 - name : Lowercase image repository name
98100 REGISTRY_USERNAME : ${{ env.DOCKERHUB_LOGIN }}
99101 run : ./hooks/push
100102 - name : Push Docker Image to GitHub Registry
103+ if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository || env.BOT_TOKEN && env.BOT_LOGIN
101104 env :
102105 REGISTRY_HOST : ghcr.io
103- REGISTRY_TOKEN : ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
104- REGISTRY_USERNAME : ${{ secrets.BOT_LOGIN || github.repository_owner }}
106+ REGISTRY_TOKEN : ${{ secrets.BOT_LOGIN && secrets. BOT_TOKEN || secrets.GITHUB_TOKEN }}
107+ REGISTRY_USERNAME : ${{ secrets.BOT_TOKEN && secrets. BOT_LOGIN || github.repository_owner }}
105108 run : ./hooks/push
You can’t perform that action at this time.
0 commit comments