Skip to content

Commit

Permalink
Use job permissions instead of token
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed May 21, 2024
1 parent 5ac64c8 commit 4b4a649
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/labels-verifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
jobs:
onMerged:
name: "Check Labels on merge"
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check Labels on merge
Expand All @@ -15,7 +17,6 @@ jobs:
! contains(github.event.pull_request.labels.*.name, 'minor')
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/maintenance_bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
labeler:
name: Assign labels and milestone
if: github.repository_owner == 'galaxyproject'
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
env:
MILESTONE_NUMBER: 28
Expand All @@ -14,7 +17,6 @@ jobs:
id: get_pr_labels
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const response = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
Expand All @@ -25,9 +27,7 @@ jobs:
return response.data;
- name: Add area labels
if: ${{ ! contains(join(fromJSON(steps.get_pr_labels.outputs.result).*.name, ', '), 'area/') }}
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/labeler@v5
- name: Assign milestone
if: |
! github.event.pull_request.milestone &&
Expand All @@ -37,7 +37,6 @@ jobs:
! github.event.pull_request.draft
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.update({
owner: context.repo.owner,
Expand Down

0 comments on commit 4b4a649

Please sign in to comment.