File tree Expand file tree Collapse file tree
src/base/.devcontainer/Mk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -283,6 +283,13 @@ Check targets (`check.mk`)
283283- ` cfn-guard-terraform ` - validates ` terraform_plans ` against cfn-guard rulesets and writes outputs to ` .cfn_guard_out/ `
284284- ` actionlint ` - runs actionlint against github actions
285285- ` secret-scan ` - runs git-secrets (including scanning history) against the repo
286+ - ` guard-<ENVIRONMENT_VARIABLE> ` - checks if an environment variable is set and errors if it is not
287+
288+ Credentials targets (` credentials.mk ` )
289+ - ` aws-configure ` - configures an AWS sso session
290+ - ` aws-login ` - Authorizes an sso session with AWS so aws cli tools can be used. You may still need to set AWS_PROFILE before running commands
291+ - ` github-login ` - Authorizes github cli to github with scope to read packages
292+ - ` create-npmrc ` - depends on ` github-login ` , then writes ` .npmrc ` with a GitHub Packages auth token and ` @nhsdigital ` registry
286293
287294Trivy targets (` trivy.mk ` )
288295- ` trivy-license-check ` - runs Trivy license scan (HIGH/CRITICAL) and writes ` .trivy_out/license_scan.txt `
Original file line number Diff line number Diff line change @@ -81,3 +81,9 @@ actionlint:
8181
8282secret-scan :
8383 git-secrets --scan-history .
84+
85+ guard-% :
86+ @ if [ " ${${* } } " = " " ]; then \
87+ echo " Environment variable $* not set" ; \
88+ exit 1; \
89+ fi
Original file line number Diff line number Diff line change 11include /usr/local/share/eps/Mk/build.mk
22include /usr/local/share/eps/Mk/check.mk
33include /usr/local/share/eps/Mk/trivy.mk
4+ include /usr/local/share/eps/Mk/credentials.mk
Original file line number Diff line number Diff line change 1+ .PHONY : aws-configure aws-login create-npmrc github-login
2+
3+ aws-configure :
4+ aws configure sso --region eu-west-2
5+
6+ aws-login :
7+ aws sso login --sso-session sso-session
8+
9+ create-npmrc : github-login
10+ echo " //npm.pkg.github.com/:_authToken=$$ (gh auth token)" > .npmrc
11+ echo " @nhsdigital:registry=https://npm.pkg.github.com" >> .npmrc
12+
13+ github-login :
14+ gh auth login --scopes read:packages
You can’t perform that action at this time.
0 commit comments