Update Contributors #606
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: Update Contributors | |
on: | |
schedule: | |
- cron: '0 9 * * *' | |
jobs: | |
update_contributors: | |
if: github.repository == 'kaigionrails/conference-app' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update JSON | |
run: | | |
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/kaigionrails/conference-app/contributors \ | |
| jq 'map(select(.login != "dependabot[bot]")) | map({login, html_url})' > contributors.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set Current Date Variable | |
run: | | |
# Capture the current date and time in ISO 8601 format | |
CURRENT_DATE=$(date +'%Y-%m-%d') | |
MESSAGE="Update contributors.json $CURRENT_DATE" | |
# Set the CURRENT_DATE as an environment variable | |
echo "MESSAGE=$MESSAGE" >> $GITHUB_ENV | |
- name: Create PR if list is updated | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
author: "Kaigi on Rails <git@kaigionrails.org>" | |
committer: "Kaigi on Rails <git@kaigionrails.org>" | |
commit-message: ${{ env.MESSAGE }} | |
delete-branch: true | |
title: ${{ env.MESSAGE }} | |
env: | |
TZ: 'Asia/Tokyo' |