2021-08-28 13:23:11 +00:00
|
|
|
name: Update contributors
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
2021-09-30 06:49:53 +00:00
|
|
|
- cron: '0 0 1 * *'
|
2021-08-28 13:23:11 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-09-26 08:36:17 +00:00
|
|
|
delete-old-branch:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
2021-09-28 10:37:54 +00:00
|
|
|
- name: Delete old contributors-update branch
|
2021-09-26 08:36:17 +00:00
|
|
|
uses: dawidd6/action-delete-branch@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
branches: contributors-update
|
2021-09-28 10:37:54 +00:00
|
|
|
|
2021-08-28 13:23:11 +00:00
|
|
|
add-contributors:
|
|
|
|
runs-on: ubuntu-latest
|
2021-09-26 08:36:17 +00:00
|
|
|
needs: delete-old-branch
|
2021-08-28 13:23:11 +00:00
|
|
|
steps:
|
2022-03-08 22:57:01 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-09-28 10:37:54 +00:00
|
|
|
|
|
|
|
- name: Create contributors-update branch
|
2022-04-04 22:43:58 +00:00
|
|
|
uses: peterjgrainger/action-create-branch@v2.2.0
|
2021-09-26 08:36:17 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
branch: 'contributors-update'
|
2021-09-28 10:37:54 +00:00
|
|
|
|
|
|
|
- name: Auto-add contributors
|
2021-09-26 08:36:17 +00:00
|
|
|
uses: BobAnkh/add-contributors@v0.2.2
|
|
|
|
with:
|
|
|
|
BRANCH: 'contributors-update'
|
|
|
|
PULL_REQUEST: 'master'
|
|
|
|
CONTRIBUTOR: '## Contributors'
|
|
|
|
COLUMN_PER_ROW: '6'
|
|
|
|
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
IMG_WIDTH: '100'
|
|
|
|
FONT_SIZE: '14'
|
|
|
|
PATH: '/CONTRIBUTORS.md'
|
|
|
|
COMMIT_MESSAGE: 'docs(CONTRIBUTORS): update contributors'
|
|
|
|
AVATAR_SHAPE: 'round'
|
2021-09-28 20:13:58 +00:00
|
|
|
|
|
|
|
# This workflow will not trigger a `pull_request` event without a PAT.
|
|
|
|
# The lint workflow is not important for this type of PR, skip it and pretend it was successful:
|
|
|
|
- name: 'Get the latest commit hash from the contributors-update branch'
|
|
|
|
id: commit-data
|
2021-09-29 22:32:45 +00:00
|
|
|
run: |
|
|
|
|
git pull
|
|
|
|
git checkout contributors-update
|
2022-11-07 08:31:29 +00:00
|
|
|
echo "head_sha=$(git rev-parse contributors-update)" >>"${GITHUB_OUTPUT}"
|
2021-09-28 20:13:58 +00:00
|
|
|
|
|
|
|
- name: 'Commit Status: Set Lint status to success (skipped)'
|
2022-06-28 09:03:57 +00:00
|
|
|
uses: myrotvorets/set-commit-status-action@1.1.5
|
2021-09-28 20:13:58 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Skipped workflows are still assigned a "success" status:
|
|
|
|
status: success
|
|
|
|
# This should be the correct commit SHA on the contributors-update branch:
|
|
|
|
sha: ${{ steps.commit-data.outputs.head_sha }}
|
|
|
|
# Name of status check to add/update:
|
|
|
|
context: 'lint'
|
|
|
|
# Optional message/note we can inline to the right of the context name in the UI:
|
|
|
|
description: "Lint skipped. Not relevant."
|