GitHub Actions中工作流推送无法触发Push工作流的问题排查
问题:GitHub Actions推送分支无法触发目标工作流
我在仓库默认分支github-base上有一个名为update_branches的GitHub Actions工作流,它会定期更新包括github/akpm-mm/mm-stable在内的多个分支(注:github是分支名称的一部分,并非远程仓库名)。
在github/akpm-mm/mm-stable分支上,我配置了一个test工作流,设置为该分支被推送时触发:
❯❯ git checkout origin/github/akpm-mm/mm-stable ❯❯ head .github/workflows/test.yaml
on: push: branches: - github/linus/master - github/akpm-mm/mm-stable - github/akpm-mm/mm-unstable
手动推送至github/akpm-mm/mm-stable分支时,test工作流能正常运行,但通过update_branches工作流推送时却无法触发。
已知使用GITHUB_TOKEN推送会禁止触发其他工作流,因此我配置了Personal Access Token(PAT),并在update_branches工作流中设置使用该令牌推送:
- name: Configure git run: | set -eux # Note - GitHub redacts secrets in logs so -x is not _that_ sketchy git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/bjackman/linux.git - name: Update branches # This will push the branches to `origin` run: .github/scripts/update_branches.sh
我已确认日志中update_branches.sh使用了配置的PAT(GitHub已将其脱敏显示为***),且本地拉取github/akpm-mm/mm-stable分支能看到新提交,但push触发的test工作流仍未运行。请问我遗漏了什么?
内容的提问来源于stack exchange,提问作者Brendan
相关产品推荐
相关产品推荐

