Skip to content

ci: restrict scheduled workflows to upstream repository - #225

Merged
HsiangNianian merged 2 commits into
HydroRoll-Team:mainfrom
Craun718:codex/upstream-only-scheduled-actions
Oct 16, 2026
Merged

HsiangNianian merged 2 commits into
HydroRoll-Team:mainfrom
Craun718:codex/upstream-only-scheduled-actions

Conversation

@Craun718

@Craun718 Craun718 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

描述

限制两个定时工作流仅在上游主仓库 HydroRoll-Team/DropOut 中运行,避免 fork 仓库执行这些工作流。

更改类型

  • Bug 修复(修复问题的非破坏性更改)
  • 新功能(添加功能的非破坏性更改)
  • 破坏性更改(会导致现有功能无法正常工作的修复或功能)
  • 文档更新
  • UI/UX 改进
  • 性能优化
  • 代码重构(无功能性更改)
  • 配置更改
  • 测试添加或更新

LLM 生成代码声明

  • 此 PR 包含 LLM 生成的代码,我不提供质量担保

相关 Issue

关闭 #
相关 #

更改内容

后端 (Rust)

  • 不适用

前端 (Svelte)

  • 不适用

配置

  • 为 Close stale issues 和 Production Smoke Check 的 job 添加仓库条件,仅当 github.repository 为 HydroRoll-Team/DropOut 时运行。

测试

测试环境

  • 操作系统:不适用
  • DropOut 版本:不适用
  • 测试的 Minecraft 版本:不适用
  • Mod 加载器:不适用

测试用例

  • 已在 Windows 上测试
  • 已在 macOS 上测试
  • 已在 Linux 上测试
  • 已测试原版 Minecraft
  • 已测试 Fabric
  • 已测试 Forge
  • 已测试游戏启动
  • 已测试登录流程
  • 已测试 Java 检测/下载

测试步骤

不适用(GitHub Actions 工作流配置更改)。

检查清单

代码质量

  • 我的代码遵循项目的代码风格指南
  • 我已对自己的代码进行了自审
  • 我已对难以理解的区域添加了注释
  • 我的更改没有产生新的警告或错误

测试验证

  • 我已在本地测试了我的更改
  • 我已添加测试来证明我的修复有效或功能正常工作
  • 新的和现有的单元测试在本地通过
  • 我至少在一个目标平台上进行了测试

文档更新

  • 我已相应地更新了文档
  • 如有需要,我已更新 README
  • 我已在必要处添加/更新代码注释

依赖项

  • 我已检查没有添加不必要的依赖项
  • 所有新依赖项都已正确记录
  • Cargo.lock 和/或 pnpm-lock.yaml 已更新(如果依赖项有变化)

截图 / 视频

不适用。

附加说明

本地提交钩子中的 YAML 检查已通过。

破坏性更改说明

不适用。


维护者专用:

  • 代码审查已完成
  • CI 检查通过
  • 准备合并

Summary by Sourcery

Limit scheduled CI workflows to the upstream repository to prevent fork executions.

Enhancements:

  • Restrict the stale issue and production smoke check scheduled jobs to run only in the upstream HydroRoll-Team/DropOut repository, including limiting pull request smoke checks to upstream branches.

CI:

  • Prevent scheduled maintenance and production smoke workflows from executing in fork repositories.

@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Both GitHub Actions jobs now use job-level conditions requiring github.repository to equal the upstream HydroRoll-Team/DropOut repository, preventing scheduled workflows from executing in forks or other repository contexts.

Flow diagram for upstream-only scheduled workflows

flowchart TD
    A[Scheduled workflow trigger] --> B{github.repository == HydroRoll-Team/DropOut}
    B -->|yes| C[Run workflow job]
    B -->|no| D[Skip workflow job]
Loading

File-Level Changes

Change Details Files
Restrict scheduled maintenance and production smoke jobs to the upstream repository.
  • Add repository equality guards to skip jobs in forks or other repositories.
  • Preserve the existing stale issue and production smoke job configurations when running upstream.
.github/workflows/production-smoke.yml
.github/workflows/stale.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/production-smoke.yml" line_range="29" />
<code_context>

 jobs:
   smoke:
+    if: github.repository == 'HydroRoll-Team/DropOut'
     name: Smoke dropout.hydroroll.team
     runs-on: ubuntu-latest
</code_context>
<issue_to_address>
**Fork pull requests run production smoke**

When a pull request from a fork targets the upstream repository, `github.repository` resolves to the upstream base repository, so the condition passes and the production smoke job runs instead of being skipped.

Check the pull request head repository, or otherwise exclude fork pull requests, rather than relying on `github.repository`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: .github/workflows/production-smoke.yml:29


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/production-smoke.yml Outdated

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@HsiangNianian HsiangNianian self-assigned this Oct 16, 2026
@HsiangNianian
HsiangNianian requested a balanced review from Copilot October 16, 2026 15:55

@HsiangNianian HsiangNianian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your commits!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The conditions implement the intended restrictions while preserving upstream scheduled execution.

0 open findings

What changed in this PR

Restricts maintenance and production smoke jobs to the upstream HydroRoll-Team/DropOut repository.

Changes:

  • Adds repository guards to both jobs.
  • Limits pull-request smoke checks to branches hosted upstream.
File Description
.github/​workflows/​stale.yml Restricts stale-issue maintenance to upstream.
.github/​workflows/​production-smoke.yml Adds upstream repository and pull-request source checks.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@HsiangNianian
HsiangNianian merged commit 248eef3 into HydroRoll-Team:main Oct 16, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants