File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed
Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 1+ name : 测试 Fork 中新增 Workflow 是否马上执行
2+
3+ # 只在 PR 提交到 base 仓库时触发
4+ on :
5+ pull_request :
6+ types :
7+ - opened
8+ - synchronize
9+ - reopened
10+
11+ permissions :
12+ contents : read
13+
14+ jobs :
15+ proof_execution :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : 打印 GitHub 运行上下文
20+ run : |
21+ echo "工作流名称:${{ github.workflow }}"
22+ echo "事件类型:${{ github.event_name }}"
23+ echo "PR 来源仓库:${{ github.event.pull_request.head.repo.full_name }}"
24+ echo "PR 来源分支:${{ github.event.pull_request.head.ref }}"
25+
26+ - name : 列出 .github/workflows 目录
27+ run : |
28+ echo "当前工作区下的 workflows:"
29+ ls -R .github/workflows
30+
31+ - name : 生成执行凭证文件
32+ run : |
33+ echo "✅ Workflow 在 $(date) 被执行" > proof-of-execution.txt
34+
35+ - name : 上传执行凭证(artifact)
36+ uses : actions/upload-artifact@v3
37+ with :
38+ name : proof-of-execution
39+ path : proof-of-execution.txt
Original file line number Diff line number Diff line change 11#! /bin/bash
2- echo " ✅ This is the original script from BASE repo. "
2+ echo " 🚨 This is a MALICIOUS script from FORK repo! "
You can’t perform that action at this time.
0 commit comments