diff --git a/.github/workflows/called.yaml b/.github/workflows/called.yaml index 737d977..584cc65 100644 --- a/.github/workflows/called.yaml +++ b/.github/workflows/called.yaml @@ -11,7 +11,7 @@ "with": "fetch-depth": 0 - "name": "check for ${{ inputs.environment }}" - "run": "cat stacks/${{ inputs.environment }}/*" + "run": "[ ${{ inputs.environment }} != \"dev\" ]" "on": "workflow_call": "inputs": diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b538191..b49d6a9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -37,7 +37,7 @@ - "id": "generate" "name": "generate matrix" "run": | - output="$(for i in dev staging prod ; do [[ -z $(git diff --name-only origin/main...HEAD | grep -E "stacks/${i}") ]] || echo $i ; done)" + output="$(for i in dev staging prod ; do [[ -z $(git diff --name-only origin/master...HEAD | grep -E "stacks/${i}") ]] || echo $i ; done)" [ -z "$output" ] || echo "matrix=[\""${output//[ ]/\", \"}"\"]" >> "$GITHUB_OUTPUT" "name": "main" "on": diff --git a/globals.tm.hcl b/globals.tm.hcl index f23a829..e07f0a5 100644 --- a/globals.tm.hcl +++ b/globals.tm.hcl @@ -10,6 +10,8 @@ globals "workflows" { } globals "repository" { + # my account is so old that the default branch was `master` + main = "master" # which environments to manage environments = ["dev", "staging", "prod"] # run workflows on all environments regardless of change diff --git a/imports/called.tm.hcl b/imports/called.tm.hcl index b9b5510..32a5b25 100644 --- a/imports/called.tm.hcl +++ b/imports/called.tm.hcl @@ -30,7 +30,7 @@ globals "workflow" "called" { }, { name = "check for $${{ inputs.environment }}" - run = "cat stacks/$${{ inputs.environment }}/*" + run = "[ $${{ inputs.environment }} != \"dev\" ]" } ] } diff --git a/imports/main.tm.hcl b/imports/main.tm.hcl index 07c0304..77c4850 100644 --- a/imports/main.tm.hcl +++ b/imports/main.tm.hcl @@ -35,7 +35,7 @@ globals "workflow" "main" { name = "generate matrix" id = "generate" run = <<-EOF - output="$(for i in ${tm_join(" ", global.repository.environments)} ; do [[ -z $(git diff --name-only origin/main...HEAD | grep -E "stacks/$${i}") ]] || echo $i ; done)" + output="$(for i in ${tm_join(" ", global.repository.environments)} ; do [[ -z $(git diff --name-only origin/${global.repository.main}...HEAD | grep -E "stacks/$${i}") ]] || echo $i ; done)" [ -z "$output" ] || echo "matrix=[\""$${output//[ ]/\", \"}"\"]" >> "$GITHUB_OUTPUT" EOF } diff --git a/stacks/dev/file b/stacks/dev/file index 6e3ceb2..a308764 100644 --- a/stacks/dev/file +++ b/stacks/dev/file @@ -1 +1,2 @@ this is dev! +and it is doomed!