Contributor credit #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Contributor credit | |
on: # yamllint disable-line rule:truthy | |
# Scheduled actions only run on the main repo branch, which is exactly what we want | |
schedule: | |
- cron: '0 0 * * 0' # At 00:00 on Sunday | |
workflow_dispatch: | |
permissions: | |
pull-requests: write | |
jobs: | |
update_credit: | |
name: Update | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GITHUB_TOKEN: ${{ github.token }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- run: pip install pygithub -e . | |
- run: python tools/dev/update_credit_json.py | |
- run: git add -f doc/sphinxext/prs/*.json | |
- run: | | |
git diff && git status --porcelain | |
if [[ $(git status --porcelain) ]]; then | |
echo "dirty=true" >> $GITHUB_OUTPUT | |
fi | |
id: status | |
- name: Create PR | |
run: | | |
set -xeo pipefail | |
git checkout -b credit | |
git config --global user.email "114827586+autofix-ci[bot]@users.noreply.github.com" | |
git config --global user.name "autofix-ci[bot]" | |
git commit -am "MAINT: Update code credit" | |
git push origin credit | |
gh pr create --head --title "MAINT: Update code credit" --body "Created by \"${{ github.workflow }}\" GitHub action." --label "no-changelog-entry-needed" | |
if: steps.status.outputs.dirty == 'true' |