Skip to content

Commit

Permalink
Set minimal workflow permissions (microsoft#53297)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnacht authored Mar 16, 2023
1 parent c797bd2 commit da8dfbf
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/accept-baselines-fix-lints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ name: Accept Baselines and Fix Lints
on:
workflow_dispatch: {}

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- main
- release-*

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
# * * * * *
- cron: '30 1 * * 0'

permissions:
contents: read

jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ensure-related-repos-run-crons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- cron: '0 0 1 * *'
workflow_dispatch: {}

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/error-deltas-watchdog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
schedule:
- cron: '0 0 * * 3' # Every Wednesday

permissions:
contents: read

jobs:
check-for-recent:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/new-release-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ on:
repository_dispatch:
types: new-release-branch

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/setup-node@v3
- run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
repository_dispatch:
types: publish-nightly

permissions:
contents: read

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

permissions:
contents: read

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

permissions:
contents: read

jobs:
richnav:
runs-on: windows-latest
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/set-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ on:
repository_dispatch:
types: set-version

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/sync-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ on:
description: 'Target Branch Name'
required: true

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/sync-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Sync Two Wiki Repos

on: [gollum]

permissions:
contents: read

jobs:
sync:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/twoslash-repros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
required: false
type: string

permissions:
contents: read

jobs:
run:
if: ${{ github.repository == 'microsoft/TypeScript' }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/update-lkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ name: Update LKG
on:
workflow_dispatch: {}

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/update-package-lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ on:
- cron: '0 6 * * *'
workflow_dispatch: {}

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript'

permissions:
contents: write

steps:
- uses: actions/checkout@v3
with:
Expand Down

0 comments on commit da8dfbf

Please sign in to comment.