fix: 修复 API URL 编码和添加缺失的 GITHUB_TOKEN 环境变量
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
88c1103bdc
commit
b162126a14
|
|
@ -17,6 +17,7 @@ jobs:
|
||||||
run: node scripts/zhuyuan-inspection.js
|
run: node scripts/zhuyuan-inspection.js
|
||||||
- name: 推送工单到Notion
|
- name: 推送工单到Notion
|
||||||
env:
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NOTION_TOKEN_BINGSUO: ${{ secrets.NOTION_TOKEN_BINGSUO }}
|
NOTION_TOKEN_BINGSUO: ${{ secrets.NOTION_TOKEN_BINGSUO }}
|
||||||
NOTION_TOKEN_ZHIZHI: ${{ secrets.NOTION_TOKEN_ZHIZHI }}
|
NOTION_TOKEN_ZHIZHI: ${{ secrets.NOTION_TOKEN_ZHIZHI }}
|
||||||
WORKORDER_DB_BINGSUO: ${{ secrets.WORKORDER_DB_BINGSUO }}
|
WORKORDER_DB_BINGSUO: ${{ secrets.WORKORDER_DB_BINGSUO }}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ function githubApi(urlPath) {
|
||||||
// ── 获取 workflow 今日最新 run ────────────────────────────────────────────
|
// ── 获取 workflow 今日最新 run ────────────────────────────────────────────
|
||||||
|
|
||||||
async function getLatestRun(workflowFile) {
|
async function getLatestRun(workflowFile) {
|
||||||
const urlPath = `/repos/${REPO}/actions/workflows/${encodeURIComponent(workflowFile)}/runs?per_page=1&created=>=${today}`;
|
const urlPath = `/repos/${REPO}/actions/workflows/${encodeURIComponent(workflowFile)}/runs?per_page=1&created=${encodeURIComponent('>=' + today)}`;
|
||||||
const data = await githubApi(urlPath);
|
const data = await githubApi(urlPath);
|
||||||
if (!data || !data.workflow_runs || data.workflow_runs.length === 0) {
|
if (!data || !data.workflow_runs || data.workflow_runs.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue