【发布时间】:2023-02-14 16:00:18
【问题描述】:
目前我尝试实施一个 github 操作(工作流程)以向新的拉取请求添加评论。
我检查了一些关于事件触发器 pull_request_target 的博客文章 (https://securitylab.github.com/research/github-actions-preventing-pwn-requests/),它导致工作流在我的存储库中运行。
我的要点是不要使用 - uses: actions/checkout@v2,这会导致不受信任的代码执行。
我的想法是从我的回购(主要分支)下载我想添加为评论的降价文件。
您认为这仍然是安全风险吗?
这是我的工作流程:
name: Checklist
on:
pull_request_target:
types:
- opened
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
curl https://raw.githubusercontent.com/org/repo/main/markdown-file.md -o markdown-file.md
const fs = require('fs');
const body = fs.readFileSync('markdown-file.md')
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body.toString()
})
【问题讨论】:
标签: github github-actions