Skip to content

Commit

Permalink
fix: reduce permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
staaldraad committed Oct 8, 2024
1 parent b844cc7 commit 5c6e517
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ on:
- reopened
- ready_for_review

permissions:
contents: read

jobs:
check-conventional-commits:
runs-on: ubuntu-latest

if: github.actor != 'dependabot[bot]' # skip for dependabot PRs
env:
EVENT: ${{ toJSON(github.event) }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -30,13 +35,13 @@ jobs:
run: |
set -ex
TMP_FILE=$(mktemp)
echo '${{ toJSON(github.event) }}' > "$TMP_FILE"
node .github/workflows/conventional-commits-lint.js pr "$TMP_FILE"
echo "${EVENT}" > "$TMP_FILE"
node .github/workflows/conventional-commits-lint.js pr "${TMP_FILE}"
- if: ${{ github.event_name == 'push' }}
run: |
set -ex
TMP_FILE=$(mktemp)
echo '${{ toJSON(github.event) }}' > "$TMP_FILE"
node .github/workflows/conventional-commits-lint.js push "$TMP_FILE"
echo "${EVENT}" > "$TMP_FILE"
node .github/workflows/conventional-commits-lint.js push "${TMP_FILE}"

0 comments on commit 5c6e517

Please sign in to comment.