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

More github actions permissions work #13154

Merged
merged 1 commit into from
Feb 1, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/auto-update-otel-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- cron: "46 * * * *"
workflow_dispatch:

permissions:
contents: read

jobs:
check-versions:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -44,7 +47,7 @@ jobs:

update-otel-sdk:
permissions:
contents: write # for Git to git push
contents: write # for git push to PR branch
runs-on: ubuntu-latest
if: |
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
backport:
permissions:
contents: write # for Git to git push
contents: write # for git push to PR branch
runs-on: ubuntu-latest
steps:
- run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-daily-no-build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- common
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- common
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
analyze:
permissions:
contents: read
actions: read # for github/codeql-action/init to get workflow details
security-events: write # for github/codeql-action/analyze to upload SARIF results
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,6 +49,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- analyze
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/issue-management-feedback-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ on:
issue_comment:
types: [created]

permissions:
contents: read

jobs:
issue_comment:
permissions:
contents: read
issues: write
if: >
contains(github.event.issue.labels.*.name, 'needs author feedback') &&
github.event.comment.user.login == github.event.issue.user.login
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/issue-management-stale-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions:
jobs:
stale:
permissions:
contents: read
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ permissions:

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/native-tests-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- graalvm-native-tests
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/overhead-benchmark-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
run-overhead-tests:
permissions:
contents: write # for writing to the gh-pages branch
contents: write # for git push to gh-pages branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -56,6 +56,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- run-overhead-tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/owasp-dependency-check-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ permissions:
jobs:
analyze:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand Down Expand Up @@ -45,6 +44,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- analyze
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
jobs:
prepare-patch-release:
permissions:
contents: write # for Git to git push
contents: write # for git push to PR branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

create-pull-request-against-release-branch:
permissions:
contents: write # for Git to git push
contents: write # for git push to PR branch
runs-on: ubuntu-latest
needs:
- prereqs
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

create-pull-request-against-main:
permissions:
contents: write # for Git to git push
contents: write # for git push to PR branch
runs-on: ubuntu-latest
needs:
- prereqs
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-petclinic-benchmark-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publishLinux
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-smoke-test-grpc-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-smoke-test-play-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-smoke-test-quarkus-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-smoke-test-servlet-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:

workflow-notification:
permissions:
contents: read
issues: write
needs:
- publish
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-update-cloudfoundry-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write
contents: read

jobs:

update-cloudfoundry-index-yml:
permissions:
contents: write # for git push to PR branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Release
on:
workflow_dispatch:

permissions:
contents: read

jobs:
required-jobs:
uses: ./.github/workflows/build-common.yml
Expand All @@ -16,6 +19,8 @@ jobs:
# and this is not a reason to hold up the release

release:
permissions:
contents: write # for creating the release
runs-on: ubuntu-latest
needs:
- required-jobs
Expand Down Expand Up @@ -181,6 +186,8 @@ jobs:
echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT

merge-change-log-to-main:
permissions:
contents: write # for git push to PR branch
runs-on: ubuntu-latest
needs:
- release
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable-native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
type: boolean
required: false

permissions:
contents: read

jobs:
graalvm-native-tests:
if: "!inputs.skip-native-tests"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/reusable-workflow-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ on:
required: true

permissions:
issues: write
contents: read

jobs:
workflow-notification:
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ on:
push:
branches: [ "main" ]

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

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
contents: read
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: "Checkout code"
Expand Down