@@ -110,25 +110,25 @@ jobs:
110
110
echo "FLOATING_TAG=${tag}" >> $GITHUB_ENV
111
111
# Handle GitHub registry used for everything other than pull requests off forked repos.
112
112
- name : Login to GitHub Docker Registry ${{env.GITHUB_REGISTRY}}
113
- if : ${{ ( github.event_name != 'pull_request') || (github. event.pull_request.head.repo.full_name == github.repository) }}
113
+ if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
114
114
uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
115
115
with :
116
116
registry : ${{ env.GITHUB_REGISTRY }}
117
117
username : ${{ github.actor }}
118
118
password : ${{ secrets.GITHUB_TOKEN }}
119
119
- name : Set Docker Tag
120
120
id : set-docker-tag-github
121
- if : ${{ ( github.event_name != 'pull_request') || (github. event.pull_request.head.repo.full_name == github.repository) }}
121
+ if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
122
122
run : |
123
123
echo "DOCKER_TAG=${GITHUB_REGISTRY}/${{ github.repository }}/${DOCKER_SERVICE}:${FULL_GIT_SHA::7}" >> $GITHUB_ENV
124
124
echo "DOCKER_FLOATING_TAG=${GITHUB_REGISTRY}/${{ github.repository }}/${DOCKER_SERVICE}:${FLOATING_TAG}" >> $GITHUB_ENV
125
125
shell : bash
126
126
# Handle Google Artifact Registry used for pull requests off forked repos.
127
127
- name : Set up Cloud SDK
128
- if : ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.fork ) }}
128
+ if : ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository ) }}
129
129
uses : isarkis/setup-gcloud@40dce7857b354839efac498d3632050f568090b6 # v1.1.1
130
130
- name : Login to GAR and set tag
131
- if : ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.fork ) }}
131
+ if : ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.repository ) }}
132
132
run : |
133
133
# Need to login to GAR to be able to push images created by fork based PR workflows.
134
134
PROJECT_NAME=$(gcloud config get-value project)
0 commit comments