Skip to content

auto-update-contributors #488

auto-update-contributors

auto-update-contributors #488

---
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- 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@1ff4c56187458b34cd602aee93e897344ce34bfc # v2.3.10
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 -->)