Skip to content

Commit

Permalink
Add cron job to sync supporters (#56)
Browse files Browse the repository at this point in the history
* test sync-supporters job

* add missing GH_TOKEN

* use github-push-action

* revert github-push-action

* simplify

* delete-branch: true

* change committer to bot

* try adding author

* actions/checkout@v4

* use peter-evans/create-pull-request@v5

* another tweak

* equal author and committer

* set author and committer to github-actions[bot]

* schedule cron

* remove on push
  • Loading branch information
Roma36 authored Sep 8, 2023
1 parent 3dc8c5d commit 84153b7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/sync-supporters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sync supporters

on:
schedule:
- cron: "0 7 * * *" # Runs daily at 7:00 UTC

jobs:
updateSupporters:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install dependencies
run: npm ci

- name: Run npm script
run: npm run sync-supporters

- name: Create/Update Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update supporters
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
title: "[Auto PR] Update supporters"
body: "Supporters list has been updated."
branch: github-action/update-supporters
delete-branch: true
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
"typecheck": "tsc",
"sync-supporters": "node ./sync-supporters.js"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
Expand Down

0 comments on commit 84153b7

Please sign in to comment.