Skip to content

Cron

Cron #1

Workflow file for this run

name: Cron
on:
workflow_dispatch:
schedule:
- cron: "1 0 * * *"
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
jobs:
run-cron:
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}
name: Run Cron
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: oven-sh/setup-bun@v2
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch || github.ref }}
- name: Install packages
run: bun install --frozen-lockfile
- name: Get GitHub App token
if: env.APP_ID != '' && env.APP_PRIVATE_KEY != ''
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.APP_PRIVATE_KEY }}
- name: Run CRON job
run: |
bun src/cron/index.ts
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token || github.token }}