Skip to content

Scheduler

Scheduler #499

Workflow file for this run

---
name: Scheduler
permissions:
contents: read
on:
pull_request:
branches:
- master
types:
- opened
- reopened
- synchronize
push:
branches:
- master
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Checkout dist
uses: actions/checkout@v6
with:
ref: dist
path: dist
persist-credentials: false # prevent using GITHUB_TOKEN to commit
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Setup env
env:
SECRET_GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
SECRET_PATREON_CREATOR_TOKEN: ${{ secrets.PATREON_CREATOR_TOKEN }}
SECRET_CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
run: |
# sponsors
{
echo "CONTRIBKIT_GITHUB_TOKEN=${SECRET_GH_BOT_TOKEN}"
echo "CONTRIBKIT_GITHUB_LOGIN=${GITHUB_REPOSITORY_OWNER}"
echo "CONTRIBKIT_PATREON_TOKEN=${SECRET_PATREON_CREATOR_TOKEN}"
} >> ./configs/sponsors/.env
# crowdin contributors
{
echo "CONTRIBKIT_CROWDIN_TOKEN=${SECRET_CROWDIN_TOKEN}"
} >> ./configs/crowdin/.env
# github contributors
{
echo "CONTRIBKIT_GITHUB_CONTRIBUTORS_TOKEN=${SECRET_GH_BOT_TOKEN}"
echo "CONTRIBKIT_GITHUB_CONTRIBUTORS_LOGIN=${GITHUB_REPOSITORY_OWNER}"
} >> ./configs/github/.env
# github contributions
{
echo "CONTRIBKIT_GITHUB_CONTRIBUTIONS_TOKEN=${SECRET_GH_BOT_TOKEN}"
} >> ./configs/githubContributions/.env
- name: Setup dist
run: |
# empty dist directory
rm -rf dist/*
# setup .gitignore
echo ".cache.json" >> dist/.gitignore
- name: Update
env:
CONTRIBKIT_GITHUB_TYPE: organization
run: npm run build
- name: Upload artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v6
with:
name: dist
path: dist
if-no-files-found: 'error'
- name: Commit and push
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5
with:
github_token: ${{ secrets.GH_BOT_TOKEN }}
author_email: ${{ secrets.GH_BOT_EMAIL }}
author_name: ${{ secrets.GH_BOT_NAME }}
branch: dist
directory: dist
force: false
message: "chore: update contributors"