Skip to content

Commit

Permalink
build: add PR write permissions to label job (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Nov 30, 2021
1 parent 2dd466c commit a13a50a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
if: {% raw %}${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}{% endraw %}
runs-on: ubuntu-latest
permissions:
contents: 'read'
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: 'google-github-actions/[email protected]'
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
script: |
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: context.repo.owner,
repo: context.repo.repo,
owner: 'GoogleCloudPlatform'
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
- if: {% raw %}${{ github.event_name == 'schedule'}}{% endraw %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: 'google-github-actions/[email protected]'
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
script: |
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: context.repo.owner,
repo: context.repo.repo,
owner: 'GoogleCloudPlatform'
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
- if: ${{ github.event_name == 'schedule'}}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/composer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: 'google-github-actions/[email protected]'
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
script: |
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: context.repo.owner,
repo: context.repo.repo,
owner: 'GoogleCloudPlatform'
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
- if: ${{ github.event_name == 'schedule'}}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/healthcare-datasets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: 'google-github-actions/[email protected]'
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
script: |
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: context.repo.owner,
repo: context.repo.repo,
owner: 'GoogleCloudPlatform'
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
- if: ${{ github.event_name == 'schedule'}}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/healthcare-dicom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: 'google-github-actions/[email protected]'
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
script: |
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: context.repo.owner,
repo: context.repo.repo,
owner: 'GoogleCloudPlatform'
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
- if: ${{ github.event_name == 'schedule'}}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/healthcare-fhir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: 'google-github-actions/[email protected]'
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
script: |
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: context.repo.owner,
repo: context.repo.repo,
owner: 'GoogleCloudPlatform'
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
- if: ${{ github.event_name == 'schedule'}}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/healthcare-hl7v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: 'google-github-actions/[email protected]'
Expand Down Expand Up @@ -48,8 +49,8 @@ jobs:
script: |
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: context.repo.owner,
repo: context.repo.repo,
owner: 'GoogleCloudPlatform'
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
- if: ${{ github.event_name == 'schedule'}}
Expand Down

0 comments on commit a13a50a

Please sign in to comment.