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?