From 7cf22313422660e3f0373ecdf682ef63bf8c507c Mon Sep 17 00:00:00 2001 From: Peter Zhang <18501667167@qq.com> Date: Fri, 29 May 2026 22:07:39 +0800 Subject: [PATCH] fix: use env var for API token, YAML folded scalar for args --- .gitea/workflows/ci.yml | 11 ++++++++--- .runner | 11 +++++++++++ scripts/create_failure_issue.py | 3 ++- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .runner diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0ca721f..867bb97 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -24,6 +24,11 @@ jobs: - name: Create issue on failure if: failure() - shell: cmd - run: | - python scripts/create_failure_issue.py --sha "${{ github.sha }}" --branch "${{ github.ref_name }}" --run "${{ github.run_number }}" --message "${{ github.event.head_commit.message }}" --api-token "${{ secrets.D }}" + env: + GITEA_API_TOKEN: ${{ secrets.D }} + run: >- + python scripts/create_failure_issue.py + --sha "${{ github.sha }}" + --branch "${{ github.ref_name }}" + --run "${{ github.run_number }}" + --message "${{ github.event.head_commit.message }}" diff --git a/.runner b/.runner new file mode 100644 index 0000000..ea27efd --- /dev/null +++ b/.runner @@ -0,0 +1,11 @@ +{ + "WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.", + "id": 1, + "uuid": "fe5aba44-dfb8-49e4-9da5-2f0dc62081e4", + "name": "document-analyzer-runner", + "token": "799fa5df52b7c7fd8df30005f4b0c02c1a7cfeb3", + "address": "http://localhost:3000", + "labels": [ + "shell:host" + ] +} diff --git a/scripts/create_failure_issue.py b/scripts/create_failure_issue.py index f04f806..b363eed 100644 --- a/scripts/create_failure_issue.py +++ b/scripts/create_failure_issue.py @@ -2,6 +2,7 @@ import argparse import json +import os import urllib.request import urllib.error @@ -15,7 +16,7 @@ def main(): parser.add_argument("--branch", required=True) parser.add_argument("--run", required=True) parser.add_argument("--message", required=True) - parser.add_argument("--api-token", required=True) + parser.add_argument("--api-token", default=os.environ.get("GITEA_API_TOKEN", "")) args = parser.parse_args() sha_short = args.sha[:7]