From 846ce88daff789649d2c6e17eac4c777b02592eb Mon Sep 17 00:00:00 2001 From: Rixuan Shao <2023311022@bipt.edu.cn> Date: Tue, 14 Jul 2026 16:15:24 +0800 Subject: [PATCH] ci: make manual checks non-sending by default --- .github/workflows/schedule.yml | 8 ++++++++ DouYinSparkFlow/tests/test_deployment_contract.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 4a03029..b84fc99 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -2,6 +2,12 @@ name: DouYin Spark Flow Schedule Run on: workflow_dispatch: + inputs: + run_task: + description: "Run the real Douyin send task after checks" + required: false + default: false + type: boolean schedule: - cron: "0 2 * * *" # 10:00 Asia/Shanghai @@ -40,8 +46,10 @@ jobs: status="$(curl -sS -o /dev/null -w '%{http_code}' --max-time 30 https://creator.douyin.com/)" test "$status" != "000" - name: Ensure Chromium is installed + if: ${{ github.event_name == 'schedule' || inputs.run_task }} run: playwright install chromium --with-deps --only-shell - name: Run DouYin Spark Flow + if: ${{ github.event_name == 'schedule' || inputs.run_task }} env: USER_DATA: ${{ secrets.USER_DATA }} SPARKFLOW_BROWSER_PROFILE_ROOT: ${{ runner.temp }}/douyin-sparkflow-browser-profiles diff --git a/DouYinSparkFlow/tests/test_deployment_contract.py b/DouYinSparkFlow/tests/test_deployment_contract.py index 25e327b..d8f4daa 100644 --- a/DouYinSparkFlow/tests/test_deployment_contract.py +++ b/DouYinSparkFlow/tests/test_deployment_contract.py @@ -16,6 +16,8 @@ class DeploymentContractTests(unittest.TestCase): self.assertIn("SPARKFLOW_BROWSER_PROFILE_ROOT", text) self.assertIn("SPARKFLOW_MANUAL_RUN", text) self.assertIn('USER_DATA: "[]"', text) + self.assertIn("run_task:", text) + self.assertGreaterEqual(text.count("github.event_name == 'schedule' || inputs.run_task"), 2) self.assertIn("path: DouYinSparkFlow/logs/", text) def test_github_actions_are_pinned_to_commit_shas(self):