Skip to content

Commit

Permalink
added explicit permissions to ci (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethahealy authored Dec 14, 2023
1 parent 2bbe326 commit ee4b466
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/confbatstest-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
- .github/workflows/confbatstest-build.yaml
- confbatstest/**

# Declare default permissions as read only.
permissions: read-all

jobs:
build-confbatstest:
permissions:
contents: read
packages: write
env:
context: confbatstest
Expand Down Expand Up @@ -63,7 +65,6 @@ jobs:
sign-confbatstest:
needs: [build-confbatstest]
permissions:
contents: read
id-token: write
packages: write
if: ${{ github.ref_type == 'tag' || github.repository_owner != 'redhat-cop' }} # Stops push running when bots create a PR, which fails due to token
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/confbatstest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/confbatstest.yaml
- confbatstest/**

# Declare default permissions as read only.
permissions: read-all

jobs:
conftest:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/disconnected-csv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- disconnected-csv/**
- .github/workflows/disconnected-csv.yaml

# Declare default permissions as read only.
permissions: read-all

jobs:
disconnected-csv:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/get-image-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/get-image-version.yaml
- get-image-version/**

# Declare default permissions as read only.
permissions: read-all

jobs:
get-image-version:
env:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/github-dispatches-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- .github/workflows/github-dispatches-build.yaml
- github-dispatches/**

# Declare default permissions as read only.
permissions: read-all

jobs:
build-github-dispatches:
env:
Expand All @@ -15,6 +18,8 @@ jobs:
ref_type: ${{ github.ref_type }}
owner: ${{ github.repository_owner }}
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/github-dispatches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/github-dispatches.yaml
- github-dispatches/**

# Declare default permissions as read only.
permissions: read-all

jobs:
github-dispatches:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/kyverno-cli-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- .github/workflows/kyverno-cli-build.yaml
- kyverno-cli/**

# Declare default permissions as read only.
permissions: read-all

jobs:
build-kyverno-cli:
env:
Expand All @@ -15,6 +18,8 @@ jobs:
ref_type: ${{ github.ref_type }}
owner: ${{ github.repository_owner }}
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/kyverno-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/kyverno-cli.yaml
- kyverno-cli/**

# Declare default permissions as read only.
permissions: read-all

jobs:
kyverno-cli:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/redhat-csp-download-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
ref_type: ${{ github.ref_type }}
owner: ${{ github.repository_owner }}
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/redhat-csp-download.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/redhat-csp-download.yaml
- redhat-csp-download/**

# Declare default permissions as read only.
permissions: read-all

jobs:
redhat-csp-download:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/set-helm-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/set-helm-version.yaml
- set-helm-version/**

# Declare default permissions as read only.
permissions: read-all

jobs:
set-helm-version:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ssh-agent-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/ssh-agent-build.yaml
- ssh-agent/**

# Declare default permissions as read only.
permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ssh-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- .github/workflows/ssh-agent.yaml
- ssh-agent/**

# Declare default permissions as read only.
permissions: read-all

jobs:
ssh-agent:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ee4b466

Please sign in to comment.