1- name : " Replenish platform pools"
1+ name : Replenish platform pools
22on :
33 workflow_call :
44 inputs :
55 gitRef :
6- description : " Commit Id from where the pools should be created"
6+ description : Commit Id from where the pools should be created
77 required : false
8- default : " main"
8+ default : main
99 type : string
1010 poolMatrixDefPath :
11- description : " Path to the file describing the pools to create"
11+ description : Path to the file describing the pools to create
1212 required : true
1313 type : string
1414 clearPools :
15- description : " If checked, clear unused scratches in the pools"
15+ description : If checked, clear unused scratches in the pools
1616 required : true
1717 type : boolean
1818 secrets :
2424 workflow_dispatch :
2525 inputs :
2626 gitRef :
27- description : " Commit Id from where the pools should be created"
27+ description : Commit Id from where the pools should be created
2828 required : false
29- default : " main"
29+ default : main
3030 poolMatrixDefPath :
31- description : " Path to the file describing the pools to create"
31+ description : Path to the file describing the pools to create
3232 required : true
33- default : " config/poolMatrixdef.json"
33+ default : config/poolMatrixdef.json
3434 clearPools :
35- description : " If checked, clear unused scratches in the pools"
35+ description : If checked, clear unused scratches in the pools
3636 required : true
3737 default : " false"
3838
3939jobs :
4040 checkScratchLimitsThreshold :
41- name : " Check Scratch limits"
41+ name : Check Scratch limits
4242 runs-on : ubuntu-latest
4343 permissions : {}
4444 outputs :
@@ -49,13 +49,13 @@ jobs:
4949 with :
5050 version : ${{ vars.SF_CLI_VERSION }}
5151
52- - name : " Authenticate Dev Hub"
52+ - name : Authenticate Dev Hub
5353 uses : navikt/sf-gha-authenticateOrg@da2f995ee865e05111574719abfc5ba12b459f0c
5454 with :
5555 auth-url : ${{ secrets.SF_DEVHUB_URL }}
5656 alias : devhub
5757
58- - name : " Check scratch org limits"
58+ - name : Check scratch org limits
5959 id : checkLimits
6060 run : |
6161 printf 'get org limits...\n' >&2
@@ -71,14 +71,14 @@ jobs:
7171 echo "canReplenishPool=true" >> "$GITHUB_OUTPUT"
7272
7373 printf 'Check remaining daily scratch orgs\n' >&2
74- if [ $remainingDailyScratchOrgs -lt ${ POOL_REMAINING_DAILY_SCRATCH_ORG_LIMIT} ]; then
75- echo "::warning title=To few remaining daily scratch orgs::Max daily scatch orgs: $maxDailyScratchOrgs. Remaining daily scratch orgs: $remainingDailyScratchOrgs. Threshold: ${ POOL_REMAINING_DAILY_SCRATCH_ORG_LIMIT} ."
74+ if [ $remainingDailyScratchOrgs -lt $POOL_REMAINING_DAILY_SCRATCH_ORG_LIMIT ]; then
75+ echo "::warning title=Too few remaining daily scratch orgs::Max daily scatch orgs: $maxDailyScratchOrgs. Remaining daily scratch orgs: $remainingDailyScratchOrgs. Threshold: $POOL_REMAINING_DAILY_SCRATCH_ORG_LIMIT."
7676 echo "canReplenishPool=false" >> "$GITHUB_OUTPUT"
7777 fi
7878
7979 printf 'Check remaining active scratch orgs\n' >&2
80- if [ $remainingActiveScratchOrgs -lt ${ POOL_REMAINING_ACTIVE_SCRATCH_ORG_LIMIT} ]; then
81- echo "::warning title=To many active Scratch Orgs::Max active scratch orgs: $maxActiveScratchOrgs. Remaining scratch orgs: $remainingActiveScratchOrgs. Threshold: ${ POOL_REMAINING_ACTIVE_SCRATCH_ORG_LIMIT} ."
80+ if [ $remainingActiveScratchOrgs -lt $POOL_REMAINING_ACTIVE_SCRATCH_ORG_LIMIT ]; then
81+ echo "::warning title=Too many active Scratch Orgs::Max active scratch orgs: $maxActiveScratchOrgs. Remaining scratch orgs: $remainingActiveScratchOrgs. Threshold: $POOL_REMAINING_ACTIVE_SCRATCH_ORG_LIMIT."
8282 echo "canReplenishPool=false" >> "$GITHUB_OUTPUT"
8383 fi
8484
9595 ref : ${{ inputs.gitRef }}
9696 fetch-depth : 0
9797 persist-credentials : false
98- - name : " Authenticate Dev Hub"
98+ - name : Authenticate Dev Hub
9999 uses : navikt/sf-gha-authenticateOrg@da2f995ee865e05111574719abfc5ba12b459f0c
100100 with :
101101 auth-url : ${{ secrets.SF_DEVHUB_URL }}
@@ -136,13 +136,13 @@ jobs:
136136
137137 - id : getMatrix
138138 run : |
139- content=$(jq --compact-output '.' "${ POOL_MATRIX_DEF_PATH}")
139+ content=$(jq --compact-output '.' "$POOL_MATRIX_DEF_PATH")
140140 echo "matrixJson=$content" >> "$GITHUB_OUTPUT"
141141 env :
142142 POOL_MATRIX_DEF_PATH : ${{ inputs.poolMatrixDefPath }}
143143
144144 createPool :
145- name : " Replenish Pool"
145+ name : Replenish Pool
146146 needs : [prepareMatrix, checkScratchLimitsThreshold]
147147 if : needs.checkScratchLimitsThreshold.outputs.canReplenishPool
148148 runs-on : ubuntu-latest
@@ -174,36 +174,36 @@ jobs:
174174 echo Pool Tag: "$POOL_TAG"
175175 echo Pool Config Path: ${{ matrix.pool.poolConfigPath }}
176176 echo Pool Delete Job Type: ${{ matrix.pool.deleteJobType }}
177- echo Clear unused scratch orgs: ${ CLEAR_POOLS}
177+ echo Clear unused scratch orgs: "$ CLEAR_POOLS"
178178 env :
179179 CLEAR_POOLS : ${{ inputs.clearPools }}
180180
181- - name : " Authenticate Dev Hub"
181+ - name : Authenticate Dev Hub
182182 uses : navikt/sf-gha-authenticateOrg@da2f995ee865e05111574719abfc5ba12b459f0c
183183 with :
184184 auth-url : ${{ secrets.SF_DEVHUB_URL }}
185185 alias : devhub
186186
187- - name : " Clear pool"
187+ - name : Clear pool
188188 id : clearPool
189189 if : ${{ inputs.clearPools }}
190190 uses : navikt/sf-gha-deleteScratchPool@1f0986d2312a2969e658946acb496f6dcd7d4032
191191 with :
192- devhub : " devhub"
192+ devhub : devhub
193193 poolTag : ${{ env.POOL_TAG }}
194194 deleteJobType : ${{ matrix.pool.deleteJobType }}
195195 isCiPool : ${{ matrix.pool.isCiPool }}
196196
197- - name : " Create Pool"
197+ - name : Create Pool
198198 run : |
199199 sfp pool prepare --poolconfig "${{ matrix.pool.poolConfigPath }}" --targetdevhubusername devhub
200200 env :
201201 NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
202202
203- - name : " Delete orphans"
203+ - name : Delete orphans
204204 uses : navikt/sf-gha-deleteScratchPool@1f0986d2312a2969e658946acb496f6dcd7d4032
205205 with :
206- devhub : " devhub"
206+ devhub : devhub
207207 deleteJobType : orphans
208208 isCiPool : ${{ matrix.pool.isCiPool }}
209209
0 commit comments