Skip to content

Commit

Permalink
tmp: test
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteMinds committed Jan 24, 2024
1 parent ba32190 commit a3d9fa2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/update_report_snapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Update Report Snapshot

on:
push:
branches: [feat/338_WeeklyReportScript]
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'
Expand All @@ -11,11 +13,14 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
repository: Magickbase/websites
repository: WhiteMinds/neuron-troubleshooting
ref: feat/338_WeeklyReportScript
- name: report:update
env:
GITHUB_TOKEN: ${{ secrets.REPORT_GITHUB_TOKEN }}
run: |
yarn install
yarn report:update
yarn workspace @magickbase-website/scripts report:update
git add packages/scripts/snapshots
- name: Set GPG
Expand All @@ -32,5 +37,5 @@ jobs:
title: Update Report Snapshot
commit-message: 'feat: update report snapshot'
body: 'After this PR is merged, a corresponding discussion will be automatically created'
committer: Chen Yu <chenyu@magickbase.com>
committer: WhiteMind <whitemind@qq.com>
branch: update-report-snapshot
2 changes: 1 addition & 1 deletion packages/scripts/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# For accessing api.github.com
# https://docs.github.com/en/rest/overview/authenticating-to-the-rest-api?apiVersion=2022-11-28
GITHUB_TOKEN=
REPORT_GITHUB_TOKEN=
3 changes: 2 additions & 1 deletion packages/scripts/src/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { paginateRest } from '@octokit/plugin-paginate-rest'
import { paginateGraphql } from '@octokit/plugin-paginate-graphql'
import { assert } from './error'

const TOKEN = process.env.GITHUB_TOKEN
const TOKEN = process.env.REPORT_GITHUB_TOKEN
assert(TOKEN != null && TOKEN !== '', 'REPORT_GITHUB_TOKEN is required')

const EnhancedOctokit = Octokit.plugin(paginateRest, paginateGraphql)
const octokit = new EnhancedOctokit({ auth: TOKEN })
Expand Down

0 comments on commit a3d9fa2

Please sign in to comment.