Skip to content

Commit

Permalink
fixed working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kneeyo1 committed Apr 11, 2024
1 parent ae17c2d commit de52de6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tacos_unlock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
id: main
run: |
# release all tfstate locks currently held
echo "$SLICES" | jq -r '.[]' | ./tacos-gha/lib/ci/unlock
jq <<< "$SLICES" -r '.[]' | ./tacos-gha/lib/ci/unlock
- name: update PR
if: always()
uses: thollander/actions-comment-pull-request@v2.4.3
Expand Down
4 changes: 2 additions & 2 deletions lib/tf_lock/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FIXME: automated testing for lib/tf_lock

```console
cd slice-0-project
alias sudo-plan='sudo-gcp -u tacos-gha-tf-plan@sac-dev-sa.iam.gserviceaccount.com'
alias sudo-apply='sudo-gcp -u tacos-gha-tf-apply@sac-dev-sa.iam.gserviceaccount.com'
alias sudo-plan='env GETSENTRY_SAC_VERB=plan sudo-gcp'
alias sudo-apply='env GETSENTRY_SAC_VERB=apply sudo-gcp'

sudo-plan tf-lock-info
> {"lock": false}
Expand Down
7 changes: 4 additions & 3 deletions lib/tf_lock/lib/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ export PATH="$TACOS_GHA_HOME/lib/tf_lock/bin:$TACOS_GHA_HOME/bin${PATH:+:$PATH}}

tf_working_dir() {
set -eEuo pipefail

root_module="$1"
if [[ -e "$root_module/terragrunt.hcl" ]]; then
( cd "$root_module"
# validate-inputs makes terragrunt generate its templates
terragrunt --terragrunt-no-auto-init=false validate-inputs

terragrunt --terragrunt-no-auto-init=false terragrunt-info |
jq -r .WorkingDir
working_dir=$(terragrunt --terragrunt-no-auto-init=false terragrunt-info |
jq -r .WorkingDir)
cd "$working_dir"
pwd
)
else
echo "$root_module"
Expand Down

0 comments on commit de52de6

Please sign in to comment.