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

Add permissions block and actions analysis #3927

Merged
merged 1 commit into from
Feb 14, 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
6 changes: 6 additions & 0 deletions .github/workflows/cli-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
find-nightly:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set permissions: {} on the top-level so any new jobs that are defined won't get permission by default? Alternatively, we could also set permissions: { contents: read } at the workflow-level and keep the permissions block on the report-failure job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

name: Find Nightly Release
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
url: ${{ steps.get-url.outputs.nightly-url }}
steps:
Expand All @@ -33,6 +35,8 @@ jobs:
set-matrix:
name: Set Matrix for cli-test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -47,6 +51,8 @@ jobs:
runs-on: ${{ matrix.os }}
needs: [find-nightly, set-matrix]
timeout-minutes: 30
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ on:
jobs:
codeql:
runs-on: ubuntu-latest
strategy:
matrix:
language:
- javascript
- actions
fail-fast: false

permissions:
contents: read
Expand All @@ -24,7 +30,7 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@main
with:
languages: javascript
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
tools: latest

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
e2e-test:
name: E2E Test
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/label-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
issues:
types: [opened]

permissions:
issues: write

jobs:
label:
name: Label issue
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build:
name: Build
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
build:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
Comment on lines +19 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, should we set this as the workflow level?

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -156,6 +158,8 @@ jobs:
needs: build
environment: publish-open-vsx
runs-on: ubuntu-latest
permissions:
contents: read
env:
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
steps:
Expand Down
Loading