Skip to content

Commit 323e0dc

Browse files
Merge pull request #78 from navikt/cleanup
clean up yaml/bash a bit
2 parents 09bec67 + f445bce commit 323e0dc

11 files changed

+149
-149
lines changed

.github/workflows/buildAndPublish.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Workflow: Build and Publish
22
# Purpose: Builds Salesforce packages and publishes artifacts.
33
# Triggers: Manual (workflow_dispatch) or workflow call.
4-
name: "Build and Publish"
4+
name: Build and Publish
55
on:
66
workflow_call:
77
outputs:
88
hasNewArtifacts:
9-
description: "Whether new artifacts were generated during the build step."
9+
description: Whether new artifacts were generated during the build step.
1010
value: ${{ jobs.buildAndPublish.outputs.artifactsFound || false}}
1111
secrets:
1212
METRICS_KEYS:
1313
required: true
1414
SF_DEVHUB_URL:
1515
required: true
16-
description: "Salesforce DevHub authentication URL"
16+
description: Salesforce DevHub authentication URL
1717
workflow_dispatch:
1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.ref_name }}
@@ -82,7 +82,7 @@ jobs:
8282
uses: navikt/sf-gha-authenticateOrg@da2f995ee865e05111574719abfc5ba12b459f0c
8383
with:
8484
auth-url: ${{ secrets.SF_DEVHUB_URL }}
85-
alias: "devhub"
85+
alias: devhub
8686
setDefaultDevhubUsername: "true"
8787

8888
- name: Get modified package names
@@ -105,12 +105,12 @@ jobs:
105105
if sfp build \
106106
--devhubalias devhub \
107107
--diffcheck \
108-
--buildnumber "${GITHUB_RUN_ID}" \
108+
--buildnumber "$GITHUB_RUN_ID" \
109109
--branch main \
110-
--releaseconfig "${PATH_TO_CONFIG_FILE}" \
111-
--loglevel "${SFP_LOG_LEVEL}" \
110+
--releaseconfig "$PATH_TO_CONFIG_FILE" \
111+
--loglevel "$SFP_LOG_LEVEL" \
112112
2>&1; then
113-
113+
114114
# Check if artifacts were generated
115115
if [ -d "artifacts" ] && [ -n "$(ls -A artifacts)" ]; then
116116
echo "Artifacts found"
@@ -131,7 +131,7 @@ jobs:
131131
if: steps.build.outputs.artifactsFound == 'true'
132132
with:
133133
files: sfdx-project.json
134-
commitMessage: "Update package versions for impacted packages"
134+
commitMessage: Update package versions for impacted packages
135135
token: ${{ secrets.GITHUB_TOKEN }}
136136

137137
- name: Publish Artifacts
@@ -142,9 +142,9 @@ jobs:
142142
sfp publish \
143143
--artifactdir artifacts \
144144
--npm \
145-
--scope "@${SCOPE}" \
145+
--scope "@$SCOPE" \
146146
--devhubalias devhub \
147-
--loglevel "${SFP_LOG_LEVEL}" \
147+
--loglevel "$SFP_LOG_LEVEL" \
148148
--gittag \
149149
--pushgittag \
150150
--logsgroupsymbol ::group::,::endgroup:: \
@@ -162,7 +162,7 @@ jobs:
162162
if: steps.build.outputs.artifactsFound == 'true'
163163
uses: navikt/sf-platform/.github/actions/uploadWorkflowArtifactsAndLogs@2587bfd49c2659fb02009a3329618e7069915f5d
164164
with:
165-
artifactName: "build-artifacts"
165+
artifactName: build-artifacts
166166
uploadArtifacts: true
167-
logName: "build-logs"
167+
logName: build-logs
168168
publishLogs: true

.github/workflows/ciCreatePlatformPool.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: "Replenish platform pools"
1+
name: Replenish platform pools
22
on:
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:
@@ -24,21 +24,21 @@ on:
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

3939
jobs:
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
@@ -95,7 +95,7 @@ jobs:
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

.github/workflows/ciCreatePlatformPoolScheduled.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "SHEDULED Replenish platform pools"
1+
name: SHEDULED Replenish platform pools
22
on:
33
# Det er satt opp skedulering for når poolet oppdateres.
44
# Det er ikke behov for å kjøre denne jobber 24/7 og det er derfor satt opp noen skeduleringer (husk at tid er UTC)

.github/workflows/ciStaticCodeValidation.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: "Run static code validation"
1+
name: Run static code validation
22
on:
33
workflow_call:
44
inputs:
55
validateEntireRepo:
6-
description: "Validate entire repo (setting to false will only validate the diff against main)"
6+
description: Validate entire repo (setting to false will only validate the diff against main)
77
default: true
88
required: false
99
type: boolean
1010
gitRef:
11-
description: "Which git ref to use"
11+
description: Which git ref to use
1212
default: ${{ github.ref }}
1313
required: false
1414
type: string
1515
workflow_dispatch:
1616
inputs:
1717
validateEntireRepo:
18-
description: "Validate entire repo (unchecking will only validate the diff against main)"
18+
description: Validate entire repo (unchecking will only validate the diff against main)
1919
default: true
2020
required: false
2121
type: boolean
@@ -28,23 +28,23 @@ jobs:
2828
security-events: write
2929
defaults:
3030
run:
31-
shell: "bash"
31+
shell: bash
3232
steps:
33-
- name: "Install SF CLI"
33+
- name: Install SF CLI
3434
uses: navikt/sf-platform/.github/actions/installSfCli@cdc0fe1ab477cdf5c025f6591f9da7601e3914f1
3535
with:
3636
version: ${{ vars.SF_CLI_VERSION }}
3737

3838
- name: "Install Salesforce Code Analyzer"
3939
run: |
4040
echo "::group::Install Salesforce Code Analyzer Plugin"
41-
sf plugins install code-analyzer@${SF_SCANNER_VERSION}
41+
sf plugins install code-analyzer@"$SF_SCANNER_VERSION"
4242
sf plugins --core
4343
echo "::endgroup::"
4444
env:
4545
SF_SCANNER_VERSION: ${{ vars.SF_SCANNER_VERSION }}
4646

47-
- name: "Checkout"
47+
- name: Checkout
4848
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
4949
with:
5050
ref: ${{ inputs.gitRef }}
@@ -61,17 +61,17 @@ jobs:
6161
prettierPathsToValidate='**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}'
6262
sfCodeAnalyzerPathToValidate='src'
6363
64-
if [ "${VALIDATE_ENTIRE_REPO}" = "false" ]; then
64+
if [ "$VALIDATE_ENTIRE_REPO" = "false" ]; then
6565
mapfile -t prettier_diffed_files_to_lint < <(git diff --name-only --diff-filter=d HEAD~ -- \*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml})
6666
mapfile -t codeAnalyzer_diffed_sf_files < <(git diff --name-only --diff-filter=d HEAD~ -- src/**/*.{cls,cmp,component,css,html,js,json,page,trigger,xml})
6767
codeAnalyzer_json=$(jq -c -n '$ARGS.positional' --args "${codeAnalyzer_diffed_sf_files[@]}")
68-
68+
6969
prettierPathsToValidate="$(printf "%s\n" "${prettier_diffed_files_to_lint[@]}")"
7070
sfCodeAnalyzerPathToValidate="$codeAnalyzer_json"
7171
fi
7272
73-
echo "prettierPathsToValidate=$prettierPathsToValidate" >> $GITHUB_OUTPUT
74-
echo "sfCodeAnalyzerPathToValidate=$sfCodeAnalyzerPathToValidate" >> $GITHUB_OUTPUT
73+
echo "prettierPathsToValidate=$prettierPathsToValidate" >> "$GITHUB_OUTPUT"
74+
echo "sfCodeAnalyzerPathToValidate=$sfCodeAnalyzerPathToValidate" >> "$GITHUB_OUTPUT"
7575
env:
7676
VALIDATE_ENTIRE_REPO: ${{ inputs.validateEntireRepo != '' && inputs.validateEntireRepo || true }}
7777

0 commit comments

Comments
 (0)