Skip to content

Commit 1a57df2

Browse files
committed
perf: eliminate runs-on input
1 parent cae5e3a commit 1a57df2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.github/workflows/tf_plan_apply.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: 'OpenTofu: Plan/Apply'
22

33
on:
44
workflow_call:
5-
inputs:
6-
runs_on:
7-
description: 'Runner JSON string'
8-
default: '"ubuntu-latest"'
9-
type: string
105
outputs:
116
tf_plan_exit_code:
127
description: 'OpenTofu Plan exit code'
@@ -24,7 +19,7 @@ permissions:
2419
jobs:
2520
tofu-plan:
2621
name: 'OpenTofu Plan'
27-
runs-on: ${{ fromJSON(inputs.runs_on) }}
22+
runs-on: ["self-hosted", "${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}" ]
2823
environment: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}
2924
env:
3025
ENVIRONMENT_NAME: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}
@@ -97,7 +92,7 @@ jobs:
9792
name: 'OpenTofu Apply'
9893
needs: [tofu-plan]
9994
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.merged) && needs.tofu-plan.outputs.tf_plan_exit_code == 2 }}
100-
runs-on: ${{ fromJSON(inputs.runs_on) }}
95+
runs-on: ["self-hosted", "${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.ref_name }}" ]
10196
environment: ${{ github.ref_name }}
10297
env:
10398
ENVIRONMENT_NAME: ${{ github.ref_name }}

0 commit comments

Comments
 (0)