diff --git a/.github/workflows/update-contributors.yaml b/.github/workflows/update-contributors.yaml new file mode 100644 index 0000000..a269e21 --- /dev/null +++ b/.github/workflows/update-contributors.yaml @@ -0,0 +1,45 @@ +name: Update CONTRIBUTORS.md + +on: + schedule: + - cron: '0 2 * * *' # Runs every day at 2am UTC + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup jq + uses: dcarbone/install-jq-action@v2 + + - name: Update CONTRIBUTORS.md + run: | + echo "# Contributors" > CONTRIBUTORS.md + p=1 + while true; do + s=$(curl "https://api.github.com/repos/mapiv/pypcd4/contributors?page=$p") || break + [ "0" = $(echo $s | jq length) ] && break + echo $s | jq -r '.[] | "* " + .login + ""' + p=$((p+1)) + done | sort -f | tee -a CONTRIBUTORS.md + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update CONTRIBUTORS.md + title: Update CONTRIBUTORS.md + body: | + This PR updates the list of contributors in CONTRIBUTORS.md. + This PR is automatically generated by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub Actions. + branch: update-contributors + add-paths: | + CONTRIBUTORS.md + labels: | + rd/chore