Skip to content

Commit

Permalink
Add missing permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed Jan 24, 2025
1 parent 1645dbd commit d390659
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/check-expected-release-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
check-expected-release-files:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout CodeQL Action
uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/codescanning-config-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
code-scanning-config-tests:
continue-on-error: true

permissions:
contents: read
packages: read
security-events: write

strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/debug-artifacts-failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
continue-on-error: true
env:
CODEQL_ACTION_TEST_MODE: true
permissions:
contents: read
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -58,6 +60,8 @@ jobs:
name: Download and check debug artifacts after failure in analyze
needs: upload-artifacts
timeout-minutes: 45
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/debug-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Check out repository
Expand Down Expand Up @@ -64,6 +66,8 @@ jobs:
name: Download and check debug artifacts
needs: upload-artifacts
timeout-minutes: 45
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/post-release-mergeback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
BASE_BRANCH: "${{ github.event.inputs.baseBranch || 'main' }}"
HEAD_BRANCH: "${{ github.head_ref || github.ref }}"

permissions:
contents: write # needed to create tags and push commits

steps:
- name: Dump environment
run: env
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
check-node-modules:
if: github.event_name != 'push' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases/v')
name: Check modules up to date
permissions:
contents: read
runs-on: macos-latest
timeout-minutes: 45

Expand All @@ -51,6 +53,8 @@ jobs:
check-file-contents:
if: github.event_name != 'push' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases/v')
name: Check file contents
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 45

Expand Down Expand Up @@ -81,6 +85,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read
runs-on: ${{ matrix.os }}
timeout-minutes: 45

Expand All @@ -101,6 +107,9 @@ jobs:
env:
BASE_REF: ${{ github.base_ref }}

permissions:
contents: read

steps:
- uses: actions/checkout@v4
- id: head-version
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/python312-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
env:
CODEQL_ACTION_TEST_MODE: true
timeout-minutes: 45
permissions:
contents: read
runs-on: windows-latest

steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/query-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
query-filters:
name: Query Filters Tests
timeout-minutes: 45
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Check out repository
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
runs-on: ubuntu-latest
if: github.event.label.name == 'Rebuild'

permissions:
contents: write # needed to push rebuilt commit
pull-requests: write # needed to comment on the PR
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/update-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
update-bundle:
if: github.event.release.prerelease && startsWith(github.event.release.tag_name, 'codeql-bundle-')
runs-on: ubuntu-latest
permissions:
contents: write # needed to push commits
pull-requests: write # needed to create pull requests
steps:
- name: Dump environment
run: env
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
timeout-minutes: 45
runs-on: macos-latest
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies') && (github.event.pull_request.head.repo.full_name == 'github/codeql-action')
permissions:
contents: write # needed to push the updated dependencies
pull-requests: write # needed to comment on the PR
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/update-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
latest_tag: ${{ steps.versions.outputs.latest_tag }}
backport_source_branch: ${{ steps.branches.outputs.backport_source_branch }}
backport_target_branches: ${{ steps.branches.outputs.backport_target_branches }}
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -63,6 +65,9 @@ jobs:
REPOSITORY: "${{ github.repository }}"
MAJOR_VERSION: "${{ needs.prepare.outputs.major_version }}"
LATEST_TAG: "${{ needs.prepare.outputs.latest_tag }}"
permissions:
contents: write # needed to push commits
pull-requests: write # needed to create pull request
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -114,6 +119,9 @@ jobs:
env:
SOURCE_BRANCH: ${{ needs.prepare.outputs.backport_source_branch }}
TARGET_BRANCH: ${{ matrix.target_branch }}
permissions:
contents: write # needed to push commits
pull-requests: write # needed to create pull request
steps:
- name: Generate token
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ jobs:
name: Update Supported Enterprise Server Versions
timeout-minutes: 45
runs-on: ubuntu-latest
if: ${{ github.repository == 'github/codeql-action' }}
if: github.repository == 'github/codeql-action'
permissions:
contents: write # needed to push commits
pull-requests: write # needed to create pull request

steps:
- name: Setup Python
Expand Down

0 comments on commit d390659

Please sign in to comment.