我已经按照这里描述的方式创建了GitHub Actions的工作流程:
https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions。 name: Dependabot auto-approve
on: pull_request_target
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
# The documentation incorrectly forgets `GITHUB_TOKEN` here.
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
以上自动化方案可行,但是我有一个分支保护规则需要代码所有者审查。
是否有一种方法可以将 github-actions
包含在 CODEOWNERS 文件中,以便使其批准计数?
PAT
代替GITHUB_TOKEN
,行为是否相同? - GuiFalourd