Skip to content

Commit 8e556da

Browse files
Create test-fork-pr.yml
1 parent b65166c commit 8e556da

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/test-fork-pr.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
# 只读内容即可,足够上传 artifact
13+
contents: read
14+
15+
jobs:
16+
proof_execution:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: 打印 GitHub 运行上下文
21+
run: |
22+
echo "工作流名称:${{ github.workflow }}"
23+
echo "事件类型:${{ github.event_name }}"
24+
echo "PR 来源仓库:${{ github.event.pull_request.head.repo.full_name }}"
25+
echo "PR 来源分支:${{ github.event.pull_request.head.ref }}"
26+
27+
- name: 列出 .github/workflows 目录
28+
run: |
29+
echo "当前工作区下的 workflows:"
30+
ls -R .github/workflows
31+
32+
- name: 生成执行凭证文件
33+
run: |
34+
echo "✅ Workflow 在 $(date) 被执行" > proof-of-execution.txt
35+
36+
- name: 上传执行凭证(artifact)
37+
uses: actions/upload-artifact@v3
38+
with:
39+
name: proof-of-execution
40+
path: proof-of-execution.txt

0 commit comments

Comments
 (0)