Files
ak-endfield-api-archive/.github/workflows/main.yml
2026-02-12 01:46:46 +09:00

45 lines
1.3 KiB
YAML

name: Auto API update check
permissions:
actions: write
checks: write
contents: write
on:
# Scheduled trigger is disabled by default
# Uncommenting the following two lines will enable it
# schedule:
# - cron: '0 16 * * *'
workflow_dispatch:
repository_dispatch:
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Create config auth
env:
CONFIG_AUTH_TXT_CTX: ${{ secrets.CONFIG_AUTH_TXT }}
run: |
mkdir -p config
echo "$CONFIG_AUTH_TXT_CTX" > config/config_auth.txt
- name: Run script
uses: nick-fields/retry@v3
with:
max_attempts: 5
timeout_minutes: 10
command: bun run src/main.ts test
- name: Format output data
run: bun x oxfmt output
- name: Git staging, commit, push
continue-on-error: true
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add output
git commit -m '[Auto] API update'
git push