0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

Check permissions for workflows (#12181)

This commit is contained in:
Bjorn Lu 2024-10-10 22:35:22 +08:00 committed by GitHub
parent 9988dd67e2
commit a55ce2977f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 3 deletions

View file

@ -20,6 +20,13 @@ jobs:
PR-BENCH: ${{ steps.benchmark-pr.outputs.BENCH_RESULT }} PR-BENCH: ${{ steps.benchmark-pr.outputs.BENCH_RESULT }}
MAIN-BENCH: ${{ steps.benchmark-main.outputs.BENCH_RESULT }} MAIN-BENCH: ${{ steps.benchmark-main.outputs.BENCH_RESULT }}
steps: steps:
- name: Check if user has write access
uses: lannonbr/repo-permission-check-action@2.0.2
with:
permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/actions/checkout/issues/331#issuecomment-1438220926 # https://github.com/actions/checkout/issues/331#issuecomment-1438220926
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:

View file

@ -13,6 +13,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check if user has write access
uses: lannonbr/repo-permission-check-action@2.0.2
with:
permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: | - run: |
gh issue edit ${{ github.event.issue.number }} --add-label "pr: preview" --repo ${{ github.repository }} gh issue edit ${{ github.event.issue.number }} --add-label "pr: preview" --repo ${{ github.repository }}
env: env:

View file

@ -25,10 +25,10 @@ jobs:
issues: write issues: write
pull-requests: write pull-requests: write
steps: steps:
- name: "Check if user has write access" - name: Check if user has write access
uses: "lannonbr/repo-permission-check-action@2.0.2" uses: lannonbr/repo-permission-check-action@2.0.2
with: with:
permission: "write" permission: write
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}