Skip to content

auto-update-contributors #820

auto-update-contributors

auto-update-contributors #820

---
name: auto-update-contributors
on:
schedule:
- cron: 30 1 * * *
workflow_call:
workflow_dispatch:
permissions:
pull-requests: write
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
contrib-readme-job:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Check for existing open contributors pull request
id: check_pr
run: |
pr_title="docs(contributor): contributors readme action update"
existing_pr=$(gh pr list --state open --search "$pr_title" --json title --jq '.[].title')
echo "::debug::List of open pull requests: $(gh pr list --state open --json title --jq '.[].title')"
if [[ -n "$existing_pr" ]]; then
echo "Contributors pull request already exists. Exiting."
echo "::warning::bypassed per open pull request already exists"
echo "OpenContributorRequestAlreadyExists=true" >> $GITHUB_ENV
exit 0
else
echo "OpenContributorRequestAlreadyExists=false" >> $GITHUB_ENV
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Contribute List
if: env.OpenContributorRequestAlreadyExists == 'false'
uses: akhilmhdh/contributors-readme-action@83ea0b4f1ac928fbfe88b9e8460a932a528eb79f # v2.3.11
with:
pr_title_on_protected: 'docs(contributor): contributors readme action update'
commit_message: 'docs(contributor): contributors readme action update'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
use_username: true
collaborators: all
# To Use This Place This Section In Readme
# # Put this in README.md
# ## Contributors
# <!-- prettier-ignore-start -->
# <!-- markdownlint-disable -->
# <!-- readme: collaborators,contributors -start -->
# <!-- readme: collaborators,contributors -end -->
# <!-- markdownlint-restore -->
# <!-- prettier-ignore-end -->)