1616 description : Toggle to run sonar code analyis on this repository.
1717 default : true
1818 required : false
19+ asdfVersion :
20+ type : string
21+ required : true
1922 reinstall_poetry :
2023 type : boolean
2124 description : Toggle to reinstall poetry on top of python version installed by asdf.
2831 - uses : actions/setup-java@v5
2932 if : ${{ inputs.install_java }}
3033 with :
31- java-version : ' 21 '
32- distribution : ' corretto'
34+ java-version : " 21 "
35+ distribution : " corretto"
3336
3437 - name : Checkout code
3538 uses : actions/checkout@v5
@@ -71,23 +74,23 @@ jobs:
7174
7275 # using git commit sha for version of action to ensure we have stable version
7376 - name : Install asdf
74- uses : asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
77+ uses : asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
7578 with :
76- asdf_branch : v0.14.1
79+ asdf_version : ${{ inputs.asdfVersion }}
7780
7881 - name : Cache asdf
7982 uses : actions/cache@v4
8083 with :
8184 path : |
8285 ~/.asdf
83- key : ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
86+ key : ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ inputs.asdfVersion }}
8487 restore-keys : |
85- ${{ runner.os }}-asdf-
88+ ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ inputs.asdfVersion }}
8689
8790 - name : Install asdf dependencies in .tool-versions
88- uses : asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
91+ uses : asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
8992 with :
90- asdf_branch : v0.14.1
93+ asdf_version : ${{ inputs.asdfVersion }}
9194 env :
9295 PYTHON_CONFIGURE_OPTS : --enable-shared
9396
9699 run : |
97100 poetry_tool_version=$(cat .tool-versions | grep poetry)
98101 poetry_version=${poetry_tool_version//"poetry "}
99- asdf uninstall poetry $poetry_version
102+ asdf uninstall poetry " $poetry_version"
100103 asdf install poetry
101104
102105 - name : Setting up .npmrc
@@ -113,16 +116,16 @@ jobs:
113116 - name : Check if project uses Poetry
114117 id : check_poetry
115118 run : |
116- if [ -f pyproject.toml ] && grep -q '\[tool.poetry\]' pyproject.toml; then
119+ if [ -f " pyproject.toml" ] && grep -q '\[tool.poetry\]' " pyproject.toml" ; then
117120 echo "****************"
118121 echo "Project uses poetry"
119122 echo "****************"
120- echo "uses_poetry=true" >> $GITHUB_OUTPUT
123+ echo "uses_poetry=true" >> " $GITHUB_OUTPUT"
121124 else
122125 echo "****************"
123126 echo "Project does not use poetry"
124127 echo "****************"
125- echo "uses_poetry=false" >> $GITHUB_OUTPUT
128+ echo "uses_poetry=false" >> " $GITHUB_OUTPUT"
126129 fi
127130
128131 - name : Check if project uses Java
@@ -132,27 +135,27 @@ jobs:
132135 echo "****************"
133136 echo "Detected a Java project"
134137 echo "****************"
135- echo "uses_java=true" >> $GITHUB_OUTPUT
138+ echo "uses_java=true" >> " $GITHUB_OUTPUT"
136139 else
137140 echo "****************"
138141 echo "Project does not use Java"
139142 echo "****************"
140- echo "uses_java=false" >> $GITHUB_OUTPUT
143+ echo "uses_java=false" >> " $GITHUB_OUTPUT"
141144 fi
142-
145+
143146 - name : Check for SAM templates
144147 id : check_sam_templates
145148 run : |
146149 if [ -d "SAMtemplates" ]; then
147150 echo "****************"
148151 echo "Project has SAM templates"
149152 echo "****************"
150- echo "sam_exists=true" >> $GITHUB_OUTPUT
153+ echo "sam_exists=true" >> " $GITHUB_OUTPUT"
151154 else
152155 echo "****************"
153156 echo "Project does not have SAM templates"
154157 echo "****************"
155- echo "sam_exists=false" >> $GITHUB_OUTPUT
158+ echo "sam_exists=false" >> " $GITHUB_OUTPUT"
156159 fi
157160
158161 - name : Check for cloudformation templates
@@ -162,27 +165,27 @@ jobs:
162165 echo "****************"
163166 echo "Project has cloudformation templates"
164167 echo "****************"
165- echo "cf_exists=true" >> $GITHUB_OUTPUT
168+ echo "cf_exists=true" >> " $GITHUB_OUTPUT"
166169 else
167170 echo "****************"
168171 echo "Project does not have cloudformation templates"
169172 echo "****************"
170- echo "cf_exists=false" >> $GITHUB_OUTPUT
173+ echo "cf_exists=false" >> " $GITHUB_OUTPUT"
171174 fi
172-
175+
173176 - name : Check for cdk
174177 id : check_cdk
175178 run : |
176179 if [ -d "packages/cdk" ]; then
177180 echo "****************"
178181 echo "Project has cdk"
179182 echo "****************"
180- echo "cdk_exists=true" >> $GITHUB_OUTPUT
183+ echo "cdk_exists=true" >> " $GITHUB_OUTPUT"
181184 else
182185 echo "****************"
183186 echo "Project does not have cdk"
184187 echo "****************"
185- echo "cdk_exists=false" >> $GITHUB_OUTPUT
188+ echo "cdk_exists=false" >> " $GITHUB_OUTPUT"
186189 fi
187190
188191 - name : Check licenses (Makefile)
@@ -203,7 +206,7 @@ jobs:
203206
204207 # known packages with dual licensing
205208 IGNORE_PACKAGES="PyGithub chardet text-unidecode"
206- LICENSES=$(poetry run pip-licenses --ignore-packages ${IGNORE_PACKAGES})
209+ LICENSES=$(poetry run pip-licenses --ignore-packages " ${IGNORE_PACKAGES}" )
207210 INCOMPATIBLE_LIBS=$(echo "$LICENSES" | grep 'GPL' || true)
208211
209212 if [[ -z $INCOMPATIBLE_LIBS ]]; then
@@ -214,7 +217,7 @@ jobs:
214217 echo "$INCOMPATIBLE_LIBS"
215218 exit 1
216219 fi
217-
220+
218221 - name : Run code lint
219222 run : make lint
220223
@@ -239,12 +242,12 @@ jobs:
239242
240243 - name : Run unit tests
241244 run : make test
242-
245+
243246 - name : Run cdk-synth
244247 if : steps.check_cdk.outputs.cdk_exists == 'true'
245248 run : |
246249 make cdk-synth
247-
250+
248251 - name : Install AWS SAM CLI
249252 if : steps.check_sam_templates.outputs.sam_exists == 'true'
250253 run : |
@@ -339,8 +342,8 @@ jobs:
339342 uses : NHSDigital/eps-action-sbom@main
340343
341344 - name : " check is SONAR_TOKEN exists"
342- env :
343- super_secret : ${{ secrets.SONAR_TOKEN }}
345+ env :
346+ super_secret : ${{ secrets.SONAR_TOKEN }}
344347 if : ${{ env.super_secret != '' && inputs.run_sonar == true }}
345348 run : echo "SONAR_TOKEN_EXISTS=true" >> "$GITHUB_ENV"
346349
0 commit comments