单主运行作业的多个跑步者在PR覆盖状态上具有相同ID

发布于 2025-01-26 01:58:45 字数 1301 浏览 3 评论 0原文

我有2名自托管跑步者 - “跑步者”& 1台机器上的“无跑者资源”。我有2个标签“运行UI测试”和“跳过UI测试”。根据标签开始的作业使用相同的作业ID,即“ PR_UI_TESTS_CHECK”,并且该作业在分支保护规则中按要求标记。

pr_check_skip_ui_tests.yaml

name: Skip UI tests on pull request`
on:
  pull_request:
    types: [ labeled, synchronize ]

jobs:
  pr_ui_tests_check:
    if: contains(github.event.pull_request.labels.*.name, 'Skip UI tests')
    runs-on: runner-resource-free
    timeout-minutes: 10

    concurrency:
      group: ${{ github.event.pull_request.number }}
      cancel-in-progress: true

    steps:
      - name: Skip tests
        run: echo "Tests skipped"

pr_check_run_ui_tests.yaml

name: Run UI tests on pull request
on:
pull_request:
types: [ labeled, synchronize ]

jobs:
pr_ui_tests_check:
if: contains(github.event.pull_request.labels.*.name, ‘Run UI tests’)
runs-on: runner
timeout-minutes: 150

concurrency:
  group: ${{ github.event.pull_request.number }}
  cancel-in-progress: true

steps:
  - uses: actions/checkout@v3
    with:
      ref: ${{ github.event.pull_request.head.sha }}

  - name: Run UI tests
    uses: ./.github/actions/run-ui-tests

当我使用标签“运行ui tests”上的pull request#1运行UI测试时,他们可以开始。但是,当我将标签“跳过UI Tests”添加到拉请求2中时,此作业完成了覆盖拉的请求#1并将“ PR_UI_TESTS_CHECK”标记为成功,因为在另一个拉的请求中跳过。我该怎么避免?

I have 2 self hosted runners - ‘runner’ & ‘runner-resource-free’ on 1 machine. I have 2 labels ‘Run UI tests’ and ‘Skip UI tests’. Jobs which start based on label use the same job id which is ‘pr_ui_tests_check’ and this job is marked as required in branch protection rules.

pr_check_skip_ui_tests.yaml

name: Skip UI tests on pull request`
on:
  pull_request:
    types: [ labeled, synchronize ]

jobs:
  pr_ui_tests_check:
    if: contains(github.event.pull_request.labels.*.name, 'Skip UI tests')
    runs-on: runner-resource-free
    timeout-minutes: 10

    concurrency:
      group: ${{ github.event.pull_request.number }}
      cancel-in-progress: true

    steps:
      - name: Skip tests
        run: echo "Tests skipped"

pr_check_run_ui_tests.yaml

name: Run UI tests on pull request
on:
pull_request:
types: [ labeled, synchronize ]

jobs:
pr_ui_tests_check:
if: contains(github.event.pull_request.labels.*.name, ‘Run UI tests’)
runs-on: runner
timeout-minutes: 150

concurrency:
  group: ${{ github.event.pull_request.number }}
  cancel-in-progress: true

steps:
  - uses: actions/checkout@v3
    with:
      ref: ${{ github.event.pull_request.head.sha }}

  - name: Run UI tests
    uses: ./.github/actions/run-ui-tests

When I run UI tests on pull request #1 using label 'Run UI tests' they start okay. But when I add label 'Skip UI tests' on pull request #2 and this job finishes it overwrites pull request #1 and marks 'pr_ui_tests_check' as success due to skip in another pull request. How can I avoid that?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文