forked from typst-doc-cn/clreq
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 1.91 KB
/
cron.yml
File metadata and controls
63 lines (60 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Scheduled check
on:
schedule:
- cron: "0 1 28 * *"
# At 01:00 on day-of-month 28. (UTC)
# https://crontab.guru/#0_1_28_*_*
workflow_dispatch:
permissions:
issues: write
jobs:
check-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- name: Load typst-version
run: |
echo "TYPST_VERSION=$(jq . scripts/typst-version.json --raw-output)" >> "$GITHUB_ENV"
- uses: typst-community/setup-typst@v4
with:
typst-version: v${{ env.TYPST_VERSION }}
- run: pnpm install
- name: Check issues and generate a report
id: check
continue-on-error: true
run: |
pnpm check-issues --assert-all-covered
env:
GH_TOKEN: ${{ github.token }}
- name: Find last report
uses: micalevisk/last-issue-action@v2
id: issue
with:
state: open
labels: |
cron-check
- name: Get date
id: date
shell: bash
run: |
echo "date=$(date --utc --iso-8601)" >> "$GITHUB_OUTPUT"
- name: Create or update the report
# If there is no last report and the check failed, create one.
# If there was a report, update it.
if: steps.issue.outputs.has-found == 'true' || steps.check.outcome == 'failure'
uses: peter-evans/create-issue-from-file@v6
with:
title: 🤖 Cron check (${{ steps.date.outputs.date }})
# Update an existing issue if one was found (issue-number),
# otherwise an empty value creates a new issue:
issue-number: "${{ steps.issue.outputs.issue-number }}"
content-filepath: "${{ steps.check.outputs.report-file }}"
labels: |
cron-check