You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何配置GitHub Action排除带特定标签的Dependabot Pull Request?

问题描述

我有一个GitHub Action工作流,会在Pull Request创建或同步时自动部署React Native Expo应用的预览版本,但希望排除Dependabot创建的Pull Request。我发现这类Pull Request带有dependencies标签,但尝试多种方式均无法实现过滤,以下是我试过的配置:

尝试过的配置

配置1

name: Preview
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  preview:
    if: ${{ !contains(github.event.pull_request.labels.*.name, '0 diff dependencies') }}

配置2

name: Preview
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  preview:
    if: "!contains(github.event.pull_request.labels.*.name, '0 diff dependencies')"

配置3

name: Preview
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  preview:
    if: "!contains(github.event.pull_request.labels.*.name, '0 dependencies')"

配置4

name: Preview
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  preview:
    if: github.event.label.name != 'dependencies'

配置5

name: Preview
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  preview:
    if: ${{ github.event.label.name != 'dependencies' }}

内容的提问来源于stack exchange,提问作者Lavínia Beghini

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 07:20:39