@@ -15,17 +15,15 @@ jobs:
1515 create-runner :
1616 uses : ./.github/workflows/create_runner.yml
1717 secrets : inherit
18- concurrency :
19- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-create-runner
20- cancel-in-progress : false
2118
2219 configuration :
2320 name : Configure job parameters
2421 runs-on : ${{ needs.create-runner.outputs.label }}
2522 needs : [create-runner]
2623 concurrency :
27- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-configuration
28- cancel-in-progress : true
24+ # github.head_ref is set by a pull_request event - contains the name of the source branch of the PR
25+ # github.ref_name is set if the event is NOT a pull_request - it contains only the branch name.
26+ group : ${{ github.head_ref || github.ref_name }}-configuration
2927 outputs :
3028 is_main_branch : ${{ (github.head_ref || github.ref) == 'refs/heads/main' }}
3129 version : ${{ steps.branches.outputs.sanitized-branch-name }}-gha.${{github.run_number}}
4240 pr_no_diff_skip : ${{ steps.pr-diff.outputs.pr_no_diff_skip }}
4341 with_werft : ${{ steps.output.outputs.with-werft }}
4442 with_integration_tests : ${{ steps.output.outputs.with_integration_tests }}
45- with_monitoring : ${{ contains( steps.pr-details.outputs.pr_body, '[x] with-monitoring') }}
4643 latest_ide_version : ${{ contains( steps.pr-details.outputs.pr_body, '[x] latest-ide-version=true') }}
4744 leeway_cache_bucket : ${{ steps.output.outputs.leeway_cache_bucket }}
4845 pr_number : ${{ steps.pr-details.outputs.number }}
9087 (needs.configuration.outputs.preview_enable == 'true')
9188 needs : [configuration, create-runner]
9289 concurrency :
93- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-build-previewctl
90+ group : ${{ github.workflow }}-${{ github.ref }}-build-previewctl
9491 cancel-in-progress : ${{ needs.configuration.outputs.is_main_branch == 'false' }}
9592 runs-on : ${{ needs.create-runner.outputs.label }}
9693 container :
@@ -118,7 +115,7 @@ jobs:
118115 (needs.configuration.outputs.is_main_branch != 'true')
119116 runs-on : ${{ needs.create-runner.outputs.label }}
120117 concurrency :
121- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-infrastructure
118+ group : ${{ github.head_ref || github.ref_name }}-infrastructure
122119 cancel-in-progress : true
123120 steps :
124121 - uses : actions/checkout@v3
@@ -138,7 +135,9 @@ jobs:
138135 needs : [configuration, create-runner]
139136 runs-on : ${{ needs.create-runner.outputs.label }}
140137 concurrency :
141- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-build-gitpod
138+ group : ${{ github.head_ref || github.ref_name }}-build-gitpod
139+ # For the main branch we always want the build job to run to completion
140+ # For other branches we only care about the "latest" version, so it is fine to cancel in-progress builds
142141 cancel-in-progress : ${{ needs.configuration.outputs.is_main_branch == 'false' }}
143142 services :
144143 mysql :
@@ -330,8 +329,8 @@ jobs:
330329 - create-runner
331330 runs-on : ${{ needs.create-runner.outputs.label }}
332331 concurrency :
333- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-install
334- cancel-in-progress : ${{ needs.configuration.outputs.is_main_branch == 'false' }}
332+ group : ${{ github.workflow }}-${{ github.ref }}-install
333+ cancel-in-progress : true
335334 steps :
336335 - uses : actions/checkout@v3
337336 - name : Deploy Gitpod to the preview environment
@@ -373,9 +372,8 @@ jobs:
373372 name : " Install Monitoring Satellite"
374373 needs : [infrastructure, build-previewctl, create-runner]
375374 runs-on : ${{ needs.create-runner.outputs.label }}
376- if : needs.configuration.outputs.with_monitoring == 'true'
377375 concurrency :
378- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-monitoring
376+ group : ${{ github.workflow }}-${{ github.ref }}-monitoring
379377 cancel-in-progress : true
380378 steps :
381379 - uses : actions/checkout@v3
@@ -400,7 +398,7 @@ jobs:
400398 image : eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-new-dev-image-gha.13182
401399 if : needs.configuration.outputs.with_integration_tests != ''
402400 concurrency :
403- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-integration-test
401+ group : ${{ github.workflow }}-${{ github.ref }}-integration-test
404402 cancel-in-progress : true
405403 steps :
406404 - uses : actions/checkout@v3
@@ -446,6 +444,3 @@ jobs:
446444 secrets : inherit
447445 with :
448446 runner-label : ${{ needs.create-runner.outputs.label }}
449- concurrency :
450- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-delete-runner
451- cancel-in-progress : false
0 commit comments