Skip to content

Commit

Permalink
[actions] improve default action permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 10, 2024
1 parent 29dce5e commit c6cfc3a
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/latest-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 'Tests: `nvm install-latest-npm`'

on: [pull_request, push]

permissions:
contents: read

jobs:
matrix:
runs-on: ubuntu-latest
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: 'Tests: linting'

on: [pull_request, push]

permissions:
contents: read

jobs:
eclint:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v2
Expand All @@ -23,8 +24,6 @@ jobs:
- run: npm run eclint

dockerfile_lint:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v2
Expand All @@ -44,8 +43,6 @@ jobs:
- run: npm run dockerfile_lint

doctoc:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v2
Expand All @@ -63,8 +60,6 @@ jobs:
- run: npm run doctoc:check

test_naming:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v2
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Automatic Rebase

on: [pull_request_target]

permissions:
contents: read

jobs:
_:
permissions:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: 'Tests: release process'

on: [pull_request, push]

permissions:
contents: read

jobs:
release:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Harden Runner
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/require-allow-edits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Require “Allow Edits”

on: [pull_request_target]

permissions:
contents: read

jobs:
_:
permissions:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: 'Tests: shellcheck'

on: [pull_request, push]

permissions:
contents: read

jobs:
shellcheck_matrix:
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -52,8 +53,4 @@ jobs:
needs: [shellcheck_matrix]
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: block
- run: true
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: urchin tests

on: [push]

permissions:
contents: read

jobs:
tests:
permissions:
Expand Down Expand Up @@ -49,6 +52,8 @@ jobs:
- run: make TERM=xterm-256color TEST_SUITE="${{ matrix.suite }}" SHELL="${{ matrix.shell }}" URCHIN="$(npx which urchin)" test-${{ matrix.shell }}

nvm:
permissions:
contents: none
name: 'all test suites, all shells'
needs: [tests]
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: update readme TOC

on: [push]

permissions:
contents: read

jobs:
_:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 'Tests on Windows: `nvm install`'

on: [pull_request, push]

permissions:
contents: read

env:
NVM_INSTALL_GITHUB_REPO: ${{ github.repository }}
NVM_INSTALL_VERSION: ${{ github.sha }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ current
npm-shrinkwrap.json
package-lock.json
yarn.lock

# rust build output
target

0 comments on commit c6cfc3a

Please sign in to comment.