Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Audited and documented permissions for gha #4910

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/actions/upload-artifact/action.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions .github/workflows/approval-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
jobs:
approval-comment:
if: startsWith(github.event.review.body, '/karpenter snapshot') || startsWith(github.event.review.body, '/karpenter scale') || startsWith(github.event.review.body, '/karpenter conformance')
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -21,4 +20,7 @@ jobs:
echo ${{ github.event.pull_request.number }} >> /tmp/artifacts/metadata.txt
echo ${{ github.event.review.commit_id }} >> /tmp/artifacts/metadata.txt
cat /tmp/artifacts/metadata.txt
- uses: ./.github/actions/upload-artifact
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: /tmp/artifacts
6 changes: 3 additions & 3 deletions .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
- cron: '0 13 * * MON'

permissions:
id-token: write
pull-requests: write
contents: write
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
pull-requests: write # name: Create Pull Request
contents: write # name: Create Pull Request

jobs:
codegen:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ jobs:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
actions: read # github/codeql-action/init@v2
security-events: write # github/codeql-action/init@v2

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]

permissions:
id-token: write
id-token: write # aws-actions/configure-aws-credentials@v4.0.1

jobs:
docgen-ci:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/e2e-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ on:
SLACK_WEBHOOK_URL:
required: true
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
statuses: write
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
statuses: write # ./.github/actions/commit-status/start
jobs:
run-suite:
name: suite-upgrade
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ on:
SLACK_WEBHOOK_URL:
required: true
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
statuses: write
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
statuses: write # ./.github/actions/commit-status/start
jobs:
run-suite:
name: suite-${{ inputs.suite }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
types: [completed]
permissions:
id-token: write
pull-requests: write
contents: write
statuses: write
jobs:
release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-test-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
schedule:
- cron: '0 13 * * MON'
permissions:
id-token: write
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
jobs:
publish-tools:
if: github.repository == 'aws/karpenter'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
push:
tags: [ 'v*.*.*' ]
permissions:
id-token: write
pull-requests: write
contents: write
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
contents: write # marvinpinto/action-automatic-releases@latest
pull-requests: write # name: Create PR
jobs:
release:
if: github.repository == 'aws/karpenter'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: [ main ]
permissions:
id-token: write
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
jobs:
release:
if: github.repository == 'aws/karpenter'
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ jobs:
StaleBot:
runs-on: ubuntu-latest
permissions:
issues: write
discussions: write
pull-requests: write
issues: write # actions/stale@v8.0.0
pull-requests: write # actions/stale@v8.0.0
if: github.repository == 'aws/karpenter'
name: Stale issue bot
steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/sweeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
- cron: '0 */12 * * *'
workflow_dispatch:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
id-token: write # aws-actions/configure-aws-credentials@v4.0.1
jobs:
sweeper:
if: vars.ACCOUNT_ID != '' || github.event_name == 'workflow_dispatch'
Expand Down