From 4f4af01cd0428c354bcee5dab7f2bc9a1982e4b4 Mon Sep 17 00:00:00 2001 From: Anmol Nagpal Date: Sun, 27 Sep 2026 11:29:00 -0400 Subject: [PATCH] feat(runners): add runs_on input to infracost, smurf-tf-checks and tf-drift Same input and default as smurf-helm-deploy and smurf-docker: runs_on defaults to ubuntu-latest, so existing callers are unchanged. Callers on self-hosted runners (for example an org k3s ARC scale set) can pass their label; today these three workflows cannot run anywhere GitHub-hosted runners are unavailable. --- .github/workflows/infracost.yml | 7 ++++++- .github/workflows/smurf-tf-checks.yml | 11 ++++++++--- .github/workflows/tf-drift.yml | 7 ++++++- docs/infracost.md | 1 + docs/smurf-tf-checks.md | 1 + 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/infracost.yml b/.github/workflows/infracost.yml index e5655947..4339b312 100644 --- a/.github/workflows/infracost.yml +++ b/.github/workflows/infracost.yml @@ -3,6 +3,11 @@ name: ๐Ÿ’ธ Infracost Analysis on: workflow_call: inputs: + runs_on: + description: GitHub Actions runner to use (for example a self-hosted runner label) + type: string + required: false + default: ubuntu-latest working-directory: required: true description: Working directory of terraform resources @@ -25,7 +30,7 @@ on: jobs: infracost: name: ๐Ÿ’ธ Infracost Analysis - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} steps: - name: ๐Ÿ› ๏ธ Setup Infracost uses: infracost/actions/setup@fb736a8f219195d6efdca58682069b16fe1bc280 # v4.2.0 diff --git a/.github/workflows/smurf-tf-checks.yml b/.github/workflows/smurf-tf-checks.yml index ad067d63..6fcb1164 100644 --- a/.github/workflows/smurf-tf-checks.yml +++ b/.github/workflows/smurf-tf-checks.yml @@ -5,6 +5,11 @@ name: ๐Ÿงช tf Checks on: workflow_call: inputs: + runs_on: + description: GitHub Actions runner to use (for example a self-hosted runner label) + type: string + required: false + default: ubuntu-latest working_directory: description: 'Directory where a complete example exists for the module.' required: false @@ -88,7 +93,7 @@ jobs: # - Terraform version extract as output. versionExtract: name: ๐Ÿท๏ธ Get min/max versions - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} outputs: minVersion: ${{ steps.minMax.outputs.minVersion }} @@ -107,7 +112,7 @@ jobs: # - Evaluating terraform version based on version extract versionEvaluate: name: ๐Ÿงช Evaluate Terraform versions - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} needs: versionExtract strategy: fail-fast: false @@ -173,7 +178,7 @@ jobs: # Action to verify terraform formatting. format: name: ๐Ÿงน Check code format - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} needs: [versionExtract, versionEvaluate] steps: diff --git a/.github/workflows/tf-drift.yml b/.github/workflows/tf-drift.yml index bb745e48..56210a9f 100644 --- a/.github/workflows/tf-drift.yml +++ b/.github/workflows/tf-drift.yml @@ -3,6 +3,11 @@ name: '๐Ÿ“ก Terraform Configuration Drift Detection' on: workflow_call: inputs: + runs_on: + description: GitHub Actions runner to use (for example a self-hosted runner label) + type: string + required: false + default: ubuntu-latest working_directory: required: true type: string @@ -94,7 +99,7 @@ on: jobs: terraform-plan: name: 'Terraform Plan' - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} env: # This is needed since we are running terraform with read-only permissions ARM_SKIP_PROVIDER_REGISTRATION: true diff --git a/docs/infracost.md b/docs/infracost.md index d8957308..4586c1bc 100644 --- a/docs/infracost.md +++ b/docs/infracost.md @@ -32,6 +32,7 @@ jobs: infracost: uses: clouddrove/github-shared-workflows/.github/workflows/infracost.yml@v2 with: + runs_on: # Optional runner label, default ubuntu-latest (e.g. a self-hosted scale set) working-directory: # Need to specify working-directory as that's where the terraform files live in the source code slack_notification: # If we need slack notification then its value is true else false secrets: diff --git a/docs/smurf-tf-checks.md b/docs/smurf-tf-checks.md index 62211d26..9be74279 100644 --- a/docs/smurf-tf-checks.md +++ b/docs/smurf-tf-checks.md @@ -26,6 +26,7 @@ jobs: terraform-checks: uses: clouddrove/github-shared-workflows/.github/workflows/smurf-tf-checks.yml@v2 with: + runs_on: # Optional runner label, default ubuntu-latest (e.g. a self-hosted scale set) working_directory: './examples/complete/' provider: 'azurerm' secrets: