@@ -15,17 +15,15 @@ jobs:
15
15
create-runner :
16
16
uses : ./.github/workflows/create_runner.yml
17
17
secrets : inherit
18
- concurrency :
19
- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-create-runner
20
- cancel-in-progress : false
21
18
22
19
configuration :
23
20
name : Configure job parameters
24
21
runs-on : ${{ needs.create-runner.outputs.label }}
25
22
needs : [create-runner]
26
23
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
29
27
outputs :
30
28
is_main_branch : ${{ (github.head_ref || github.ref) == 'refs/heads/main' }}
31
29
version : ${{ steps.branches.outputs.sanitized-branch-name }}-gha.${{github.run_number}}
42
40
pr_no_diff_skip : ${{ steps.pr-diff.outputs.pr_no_diff_skip }}
43
41
with_werft : ${{ steps.output.outputs.with-werft }}
44
42
with_integration_tests : ${{ steps.output.outputs.with_integration_tests }}
45
- with_monitoring : ${{ contains( steps.pr-details.outputs.pr_body, '[x] with-monitoring') }}
46
43
latest_ide_version : ${{ contains( steps.pr-details.outputs.pr_body, '[x] latest-ide-version=true') }}
47
44
leeway_cache_bucket : ${{ steps.output.outputs.leeway_cache_bucket }}
48
45
pr_number : ${{ steps.pr-details.outputs.number }}
90
87
(needs.configuration.outputs.preview_enable == 'true')
91
88
needs : [configuration, create-runner]
92
89
concurrency :
93
- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-build-previewctl
90
+ group : ${{ github.workflow }}-${{ github.ref }}-build-previewctl
94
91
cancel-in-progress : ${{ needs.configuration.outputs.is_main_branch == 'false' }}
95
92
runs-on : ${{ needs.create-runner.outputs.label }}
96
93
container :
@@ -118,7 +115,7 @@ jobs:
118
115
(needs.configuration.outputs.is_main_branch != 'true')
119
116
runs-on : ${{ needs.create-runner.outputs.label }}
120
117
concurrency :
121
- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-infrastructure
118
+ group : ${{ github.head_ref || github.ref_name }}-infrastructure
122
119
cancel-in-progress : true
123
120
steps :
124
121
- uses : actions/checkout@v3
@@ -138,7 +135,9 @@ jobs:
138
135
needs : [configuration, create-runner]
139
136
runs-on : ${{ needs.create-runner.outputs.label }}
140
137
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
142
141
cancel-in-progress : ${{ needs.configuration.outputs.is_main_branch == 'false' }}
143
142
services :
144
143
mysql :
@@ -330,8 +329,8 @@ jobs:
330
329
- create-runner
331
330
runs-on : ${{ needs.create-runner.outputs.label }}
332
331
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
335
334
steps :
336
335
- uses : actions/checkout@v3
337
336
- name : Deploy Gitpod to the preview environment
@@ -373,9 +372,8 @@ jobs:
373
372
name : " Install Monitoring Satellite"
374
373
needs : [infrastructure, build-previewctl, create-runner]
375
374
runs-on : ${{ needs.create-runner.outputs.label }}
376
- if : needs.configuration.outputs.with_monitoring == 'true'
377
375
concurrency :
378
- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-monitoring
376
+ group : ${{ github.workflow }}-${{ github.ref }}-monitoring
379
377
cancel-in-progress : true
380
378
steps :
381
379
- uses : actions/checkout@v3
@@ -400,7 +398,7 @@ jobs:
400
398
image : eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-new-dev-image-gha.13182
401
399
if : needs.configuration.outputs.with_integration_tests != ''
402
400
concurrency :
403
- group : ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-integration-test
401
+ group : ${{ github.workflow }}-${{ github.ref }}-integration-test
404
402
cancel-in-progress : true
405
403
steps :
406
404
- uses : actions/checkout@v3
@@ -446,6 +444,3 @@ jobs:
446
444
secrets : inherit
447
445
with :
448
446
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