diff --git a/.github/workflows/update-authors.yml b/.github/workflows/update-authors.yml index a388148..6535e26 100644 --- a/.github/workflows/update-authors.yml +++ b/.github/workflows/update-authors.yml @@ -8,7 +8,7 @@ on: - cron: '0 0 1 * *' # Monthly workflow_dispatch: # Manual trigger -permissions: # Add explicit permissions block at workflow level +permissions: contents: write pull-requests: write @@ -19,14 +19,18 @@ jobs: steps: - uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} # Explicitly set the token + token: ${{ secrets.GITHUB_TOKEN }} - name: Update AUTHORS file env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Fetch all contributors using GitHub CLI - contributors=$(gh api repos/tphakala/birdnet-go/contributors --jq '.[].login') + # Fetch all contributors using GitHub CLI and filter out bots and owner + contributors=$(gh api repos/tphakala/birdnet-go/contributors --jq '.[].login' | \ + grep -v "tphakala" | \ + grep -v "dependabot\[bot\]" | \ + grep -v "^bot-" | \ + sort) # Create new AUTHORS file cat > AUTHORS << EOL @@ -35,7 +39,7 @@ jobs: Tomi P. Hakala Contributors: - $(echo "$contributors" | grep -v "tphakala" | sed 's/^/@/') + $(echo "$contributors" | sed 's/^/@/') Please let me know if you are missing from contributors list! @@ -54,12 +58,17 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.GITHUB_TOKEN }} # Explicitly set the token + token: ${{ secrets.GITHUB_TOKEN }} commit-message: 'docs: update AUTHORS file with current contributors' title: 'Update AUTHORS file' body: | Automatically updated AUTHORS file with current GitHub contributors. + Changes: + - Updated contributors list + - Excluded dependabot and other bots + - Sorted contributors alphabetically + This PR was created automatically by the update-authors workflow. branch: update-authors delete-branch: true \ No newline at end of file