Skip to content

Commit

Permalink
Improve Workflow Permissions (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgocode authored Jun 12, 2024
1 parent e1b717f commit be6c508
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
branches:
- main

permissions: read-all

env:
API_URL: https://api.github.com/repos/${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.PAT_ATTACH_TO_RELEASE }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/on-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
types:
- prereleased

permissions: read-all

env:
ARTIFACTS_API_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT_ATTACH_TO_RELEASE }}
Expand Down Expand Up @@ -143,7 +145,6 @@ jobs:
runs-on: ubuntu-latest
needs: azure-publish
permissions:
actions: read
contents: write
outputs:
sbom-hash-code: ${{ steps.sbom-hash-code.outputs.sbom-hash-code }}
Expand Down Expand Up @@ -191,7 +192,6 @@ jobs:
needs:
- sbom-create
permissions:
actions: read
contents: write
steps:
- name: Download the SBOM
Expand Down Expand Up @@ -228,7 +228,6 @@ jobs:
name: Create Provenance
needs: azure-publish
permissions:
actions: read
id-token: write
contents: write
uses: Ed-Fi-Alliance-OSS/slsa-github-generator/.github/workflows/[email protected]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/on-pullrequest-dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
- "docker/*"
workflow_dispatch:

permissions: read-all

jobs:
docker-testing:
runs-on: ubuntu-latest
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/on-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
- ".github/**"
workflow_dispatch:

permissions: read-all

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -82,8 +84,6 @@ jobs:
needs: upgrade
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
Expand All @@ -101,8 +101,6 @@ jobs:
env:
SRC_DIR: Meadowlark-js
permissions:
actions: read
contents: read
security-events: write

steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
types:
- released

permissions: read-all

env:
ARTIFACTS_API_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}
ARTIFACTS_USERNAME: ${{ vars.AZURE_ARTIFACTS_USER_NAME }}
Expand Down

0 comments on commit be6c508

Please sign in to comment.