mirror of
https://github.com/netfun2000/docker-php-nginx.git
synced 2026-04-22 00:29:10 +08:00
Only login to Docker Hub when pushing on master branch
This commit is contained in:
3
.github/workflows/build.yaml
vendored
3
.github/workflows/build.yaml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
- name: Run Trivy vulnerability scanner
|
||||
uses: aquasecurity/trivy-action@master
|
||||
with:
|
||||
image-ref: '${{ env.IMAGE_NAME }}:${{ github.sha }}'
|
||||
image-ref: '${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}'
|
||||
format: 'template'
|
||||
template: '@/contrib/sarif.tpl'
|
||||
output: 'trivy-results.sarif'
|
||||
@@ -49,6 +49,7 @@ jobs:
|
||||
sarif_file: 'trivy-results.sarif'
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
|
||||
Reference in New Issue
Block a user