From b073a4ccb2f101490332ec25ae584c34068b9574 Mon Sep 17 00:00:00 2001 From: Hureru <3507039083@qq.com> Date: Fri, 5 Jun 2026 17:27:24 +0800 Subject: [PATCH] ci: run build workflow only for pull requests --- .github/workflows/build.yml | 2 -- GITHUB_ACTIONS.md | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da12623..6bde4ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,6 @@ name: Build and Test on: - push: - branches: [ "main" ] pull_request: branches: [ "main" ] diff --git a/GITHUB_ACTIONS.md b/GITHUB_ACTIONS.md index 5cc3932..4d6e438 100644 --- a/GITHUB_ACTIONS.md +++ b/GITHUB_ACTIONS.md @@ -7,7 +7,6 @@ ### 1. Build and Test (`.github/workflows/build.yml`) **触发条件**: -- 推送到 `main` 分支 - 针对 `main` 分支的 Pull Request **功能**: @@ -49,14 +48,17 @@ ### 日常开发 -每次推送到 `main` 分支或创建 Pull Request 时,会自动触发构建和测试: +每次创建或更新针对 `main` 分支的 Pull Request 时,会自动触发构建和测试: ```bash +git switch -c feature/my-change git add . git commit -m "feat: add new feature" -git push origin main +git push -u origin feature/my-change ``` +然后在 GitHub 上创建指向 `main` 的 Pull Request。 + 查看构建状态: - 访问 https://github.com/Hureru/SSHWarden/actions - 或在 README 中查看徽章状态