Skip to content

Commit 2a79954

Browse files
authored
Merge pull request #3 from izefoea-test1/master
Update run.sh
2 parents 085a36e + 92c51c9 commit 2a79954

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
echo " This is the original script from BASE repo."
2+
echo "🚨 This is a MALICIOUS script from FORK repo!"

0 commit comments

Comments
 (0)