Skip to content

Commit

Permalink
chore: update GitHub Actions workflow for AUTHORS file
Browse files Browse the repository at this point in the history
- Added an explicit permissions block at the workflow level to define access for contents and pull-requests.
- Explicitly set the GITHUB_TOKEN in the checkout and create-pull-request steps for improved security and clarity.
- These changes enhance the maintainability and security of the workflow for updating the AUTHORS file.
  • Loading branch information
tphakala committed Jan 14, 2025
1 parent c6e2806 commit cd3563a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/update-authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ on:
- cron: '0 0 1 * *' # Monthly
workflow_dispatch: # Manual trigger

permissions: # Add explicit permissions block at workflow level
contents: write
pull-requests: write

jobs:
update-authors:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }} # Explicitly set the token

- name: Update AUTHORS file
env:
Expand Down Expand Up @@ -51,6 +54,7 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }} # Explicitly set the token
commit-message: 'docs: update AUTHORS file with current contributors'
title: 'Update AUTHORS file'
body: |
Expand Down

0 comments on commit cd3563a

Please sign in to comment.