Skip to content

Commit

Permalink
Fix GitHub Actions workflow permissions
Browse files Browse the repository at this point in the history
In contrast to DT v4.x, we're currently publishing our images to ghcr.io instead of Docker Hub. For this, we need the `package: write` permission.

Further, port DependencyTrack/dependency-track@ba51b5c.

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Feb 13, 2024
1 parent 9498b4e commit a0ffa03
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/_meta-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
build-container:
runs-on: ubuntu-latest
permissions:
packages: write # Required to push images to ghcr.io
security-events: write # Required to upload trivy's SARIF output
needs:
- build-java
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
app-version: "snapshot"
publish-container: ${{ github.ref == 'refs/heads/main' }}
permissions:
packages: write # Required to push images to ghcr.io
security-events: write # Required to upload trivy's SARIF output
secrets:
registry-0-usr: ${{ github.repository_owner }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
app-version: ${{ needs.read-version.outputs.version }}
publish-container: true
permissions:
packages: write # Required to push images to ghcr.io
security-events: write # Required to upload trivy's SARIF output
secrets:
registry-0-usr: ${{ github.repository_owner }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
create-release:
runs-on: ubuntu-latest
permissions:
# Required for pushing changes via git command (rather than via GitHub API).
# TODO: Use bot credentials for git, or rewrite the "Commit Version" step to use API instead.
contents: write
needs:
- prepare-release

Expand Down

0 comments on commit a0ffa03

Please sign in to comment.