返回首页

对比阅读

对比阅读:Your GitHub Actions Task May Have Been Silently Altered: Add a Lock 与 你的代码自动任务可能被人偷偷改了:加一道锁再放心

AEN
GitHub Actions独立开发者自由职业者·

Your GitHub Actions Task May Have Been Silently Altered: Add a Lock

The First Time I Saw an Automated Task Change, I Panicked

Late one night last week, I opened my GitHub project and found an extra step in the automatic publishing flow: it downloaded an unfamiliar script. It used to only tidy up text; now it could access customer files in the repository. I stopped the workflow immediately, but my palms were still sweating. Only later did I realize that these “helpful little robots” save time while also handing part of the decision-making power to third parties.

I’m not saying everyone using GitHub Actions should lock down every task today. First, I’d identify the tasks that, if altered, could touch customer files, send messages, or spend money.

What It Is, and Why People Use It

Simply put, GitHub Actions lets GitHub do things step by step: test after every code commit, generate files, publish content. Adding manual approval to a critical step is like putting a lock on the office door that only you can open. The workflow reaches the door, waits for me to click “Approve,” and only then continues.

I know an indie developer, Lin Zhe, who takes remote contract projects in Hangzhou. He requires manual approval for “update the client delivery package” so an automated workflow cannot accidentally overwrite files. Another freelancer, A Chen, maintains a personal website in Shenzhen. He locks only the step that publishes live content; test tasks still run automatically. That way, there’s less hassle without throwing away every convenience.

What It Costs to Replicate Today

Money: GitHub’s free personal tier is usually enough for a small project, and the extra configuration generally costs 0 yuan; if you use a team plan, your actual bill is the deciding factor.
Time: The first pass takes about 30–60 minutes; adding the lock itself usually takes around 10 minutes.
Technical barrier: I need to read a little GitHub workflow configuration, but no advanced programming skills. On the first try, I can follow the documentation line by line.
First step: Open the GitHub repository, click “Actions,” enter the workflow I use most, then click “Edit workflow file” in the upper-right corner. Find the step that needs confirmation and add the manual approval setting. I won’t start with an important repository; I’ll practice on a test project first.

Depending on My Current Stage, Here’s What I’d Lock

If I’m just starting and the project has no formal clients yet, I’d keep the default settings and only disable third-party connections I don’t need. Not every tool suits every setup, and there’s no rush to try this now.
If I already have one or two clients, I’d review every step involving client files, email, and payments, then add manual approval to the one or two most critical steps.
If I’m scaling up, I’d do more than lock the workflow: I’d also review automated tasks and access permissions once a month, and separate the approver from the backup owner. I’m not doing this to look overly cautious. I’m doing it so that, when something breaks, another person can take over quickly.

来源: hugovk.dev
BZH
GitHub Actions独立开发者自由职业者·

你的代码自动任务可能被人偷偷改了:加一道锁再放心

我第一次看到自动化任务被改,还是有点慌

上周凌晨,我打开自己的 GitHub 项目,发现自动发布流程多了一步:下载了一个陌生脚本。以前它只负责整理文字,现在却能接触仓库里的客户资料。我赶紧停掉流程,但手心还是出汗。后来我才明白,这类“自动帮忙做事”的任务,省时间的同时,也把一部分决定权交给了第三方。

如果你也用 GitHub Actions,这篇文章不是让你立刻全部上锁,而是先找出那些一旦被改动就可能碰客户文件、发消息或花钱的任务。

它是什么,为什么会有人在用

简单说,GitHub Actions 就是让 GitHub 按步骤自动做事:每次提交代码后,帮你测试、生成文件、发布内容。给关键步骤加上人工确认,就像给办公室的门加一把需要本人开锁的门。任务走到门口时,先等你点“批准”,再继续。

我认识一位做独立开发的朋友林哲,在杭州远程接外包项目。他把“更新客户交付包”设成需要手动批准,避免自动流程误覆盖文件。另一位自由职业者阿晨,在深圳维护个人网站,则只给能发布正式内容的步骤加锁,测试任务仍然自动跑。这样既少一点折腾,也没有把所有便利都扔掉。

你今天复刻的成本

钱:GitHub 的个人免费额度通常够小项目使用,额外配置基本是 0 元;如果你用团队套餐,以你实际账单为准。
时间:第一次梳理大约 30-60 分钟,真正加锁通常 10 分钟左右。
技术门槛:需要会看一点 GitHub 的工作流文件,但不用学复杂编程;第一次可以照着文档逐行改。
第一步:打开 GitHub 仓库,点“Actions”,进入你最常用的工作流,再点右上角“Edit workflow file”,找到要确认的步骤,加入人工批准设置。别先改重要仓库,先拿测试项目练一遍。

按你现在的阶段,我会这样选

如果你刚起步、项目还没有正式客户,我会先保持默认设置,只关闭不需要的第三方连接;这类工具不是所有人都需要,现在不试也没事。
如果你已经有 1-2 个客户,我会先把涉及客户文件、邮件发送和付款的步骤逐个过一遍,给最关键的一两个加人工确认。
如果你正在扩规模,除了加锁,我还会把自动任务和权限清单每月复核一次,并把批准人和备份负责人分开。这样做不是为了显得谨慎,而是让系统出问题时,还有一个人能及时接手。

来源: hugovk.dev