Skip to content

Scheduler

Scheduler #148

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@v4
- name: Checkout dist
uses: actions/checkout@v4
with:
ref: dist
path: dist
persist-credentials: false # prevent using GITHUB_TOKEN to commit
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Setup env
run: |
# sponsors
echo "CONTRIBKIT_GITHUB_TOKEN=${{ secrets.GH_BOT_TOKEN }}" >> ./configs/sponsors/.env
echo "CONTRIBKIT_GITHUB_LOGIN=${{ github.repository_owner }}" >> ./configs/sponsors/.env
echo "CONTRIBKIT_PATREON_TOKEN=${{ secrets.PATREON_CREATOR_TOKEN }}" >> ./configs/sponsors/.env
# crowdin contributors
echo "CONTRIBKIT_CROWDIN_TOKEN=${{ secrets.CROWDIN_TOKEN }}" >> ./configs/crowdin/.env
# github contributors
echo "CONTRIBKIT_GITHUB_CONTRIBUTORS_TOKEN=${{ secrets.GH_BOT_TOKEN }}" >> ./configs/github/.env
echo "CONTRIBKIT_GITHUB_CONTRIBUTORS_LOGIN=${{ github.repository_owner }}" >> ./configs/github/.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@v4
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/[email protected]
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"