GitHub Actions - 忽略或排除 Dependabot Pull 请求

发布于 2025-01-17 23:56:34 字数 1103 浏览 2 评论 0原文

我在其中有一个带有 disterabot 的存储库,它在我想保留的版本更新等上打开PR。

在同一存储库中,我有一个github诉讼,用于拉动请求供我的团队使用。

我的问题是,无论我尝试什么,依赖关系都会继续触发拉动请求操作。

我的公关操作必须在登台分支拉力请求时触发,因此

name: Pull Request
on:
  pull_request:
    branches:
      - staging

我不能在plul_reuqest和branches_ignore上同时使用 - 如文档

没有使用过的工作流

name: Pull Request
on:
  pull_request:
    branches:
      - staging
      - '!dependabot/**'

name: Pull Request
on:
  pull_request:
    branches:
      - staging

jobs:
  Build:
    if: github.actor!= 'dependabot-preview[bot]'
    name: Build
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v2

我已经尝试过的工作流量尝试我还 尝试像这样的Displyabot用户

if: github.actor!= 'depbot'

会喜欢您如何处理此问题的一些见解或答案。

谢谢!

I have a repository with Dependabot in it, that opens PR on version updates, etc which I would like to keep.

In the same repository, I have a GitHub Action for Pull Requests for my team to use.

My issue is that the Dependabot keeps triggering the Pull Request action no matter what I tried.

My PR action have to be triggered on staging branch pull requests, like so:

name: Pull Request
on:
  pull_request:
    branches:
      - staging

So I can't use both on pull_reuqest AND branches_ignore - as stated in the documentation

Workflow attempts I have tried so far that unfortunately haven't worked:

name: Pull Request
on:
  pull_request:
    branches:
      - staging
      - '!dependabot/**'

name: Pull Request
on:
  pull_request:
    branches:
      - staging

jobs:
  Build:
    if: github.actor!= 'dependabot-preview[bot]'
    name: Build
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@v2

I have also tried excluding the Dependabot user like so:

if: github.actor!= 'depbot'

Would love some insights or answers on how you have dealt with this issue.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南汐寒笙箫 2025-01-24 23:56:35

我想多年来发生了许多变化,您可以在整个网络上找到过时的方式。实际方法是在依赖器文档中

if: ${{ github.actor != 'dependabot[bot]' }}

请注意,如今您还可以检查 github.triggering_actor - 如果您希望触发工作流程,请跳过工作流,但希望能够在Depplyabot打开的PR上手动触发它。

I guess there were many changes over the years and you can find outdated ways all over the web. The actual way is documented in the Dependabot documentation

if: ${{ github.actor != 'dependabot[bot]' }}

Note that nowadays you can also check the github.triggering_actor - if you want workflow to be skipped if Dependabot triggered it, but want to be able to manually trigger it on a PR that was opened by Dependabot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文