chore: add minimal workflow permissions (#70)

This commit is contained in:
Jonathan Yu 2021-05-22 10:41:21 -07:00 committed by GitHub
parent 4a7045f1b4
commit 1af4050abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 4 deletions

View File

@ -15,13 +15,25 @@ on:
workflow_dispatch:
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
# Quick checks, running linters, checking formatting, etc
quick:
runs-on: ubuntu-20.04
steps:
- name: Cancel previous runs
if: ${{ github.event_name == 'pull_request' }}
if: github.event_name == 'pull_request'
uses: styfle/cancel-workflow-action@0.9.0
- name: Checkout
@ -49,7 +61,7 @@ jobs:
name: images/${{ matrix.job}}
steps:
- name: Cancel previous runs
if: ${{ github.event_name == 'pull_request' }}
if: github.event_name == 'pull_request'
uses: styfle/cancel-workflow-action@0.9.0
- name: Checkout
@ -61,14 +73,14 @@ jobs:
--tag=${{ matrix.job }}
- name: Authenticate to Docker Hub
if: ${{ github.event_name != 'pull_request' }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push images to Docker Hub
if: ${{ github.event_name != 'pull_request' }}
if: github.event_name != 'pull_request'
run: |
${{ github.workspace}}/scripts/push_images.sh \
--tag=${{ matrix.job}}