-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (49 loc) · 1.73 KB
/
update_report_snapshot.yaml
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
name: Update Report Snapshot
on:
workflow_dispatch:
schedule:
# Every Friday at 18:00 Beijing time.
- cron: '0 10 * * 5'
jobs:
default:
runs-on: ubuntu-latest
permissions:
# peter-evans/create-pull-request requires the following permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: report:update
id: report_update
env:
# The script requires public_repo, read:org, read:project permissions, and needs a personal access token (classic) to obtain these permissions.
GITHUB_TOKEN: ${{ secrets.REPORT_GITHUB_TOKEN }}
run: |
yarn install
{
echo 'DEVLOG<<EOF'
yarn workspace @magickbase-website/scripts report:update | sed '0,/^generateDevlogFromSnapshotsDiff():$/d'
echo EOF
} >> $GITHUB_OUTPUT
git add packages/scripts/snapshots
- name: Set GPG
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Open PR to repo
uses: peter-evans/create-pull-request@v5
with:
title: Update Report Snapshot
commit-message: 'feat: update report snapshot'
body: '
After this PR is merged, a corresponding devlog discussion will be automatically created, with the content preview as follows
---
${{ steps.report_update.outputs.DEVLOG }}
'
committer: ${{ vars.COMMITTER }}
branch: update-report-snapshot