Skip to content

Commit c2e10c6

Browse files
authored
Merge pull request #28 from mpminardi/mpminardi/fix-fmt-action
Fix format action to work with forks
2 parents 1dda8c6 + ba660e6 commit c2e10c6

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

.github/workflows/terraform-fmt.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: terraform-fmt
22
on:
3-
push:
4-
branches: [main]
53
pull_request:
64
branches: [main]
75

@@ -11,16 +9,14 @@ jobs:
119
steps:
1210
# checkout code
1311
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
12+
with:
13+
ref: ${{ github.event.pull_request.head.ref }}
14+
repository: ${{ github.event.pull_request.head.repo.full_name }}
1415

1516
# format terraform
1617
- name: Setup Terraform
1718
uses: hashicorp/setup-terraform@v2
1819
with:
1920
terraform_version: "1.3.0"
2021
- name: Terraform fmt
21-
run: terraform fmt -recursive
22-
23-
# Commit all changed files back to the repository
24-
- uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a
25-
with:
26-
commit_message: Formatted Terraform
22+
run: terraform fmt -check -recursive

aws/tfc-workspace.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provider "tfe" {
99
#
1010
# https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/project
1111
data "tfe_project" "tfc_project" {
12-
name = var.tfc_project_name
12+
name = var.tfc_project_name
1313
organization = var.tfc_organization_name
1414
}
1515

azure/tfc-workspace.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provider "tfe" {
99
#
1010
# https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/project
1111
data "tfe_project" "tfc_project" {
12-
name = var.tfc_project_name
12+
name = var.tfc_project_name
1313
organization = var.tfc_organization_name
1414
}
1515

gcp/tfc-workspace.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provider "tfe" {
99
#
1010
# https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/project
1111
data "tfe_project" "tfc_project" {
12-
name = var.tfc_project_name
12+
name = var.tfc_project_name
1313
organization = var.tfc_organization_name
1414
}
1515

vault-backed/aws/tfc-workspace.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provider "tfe" {
99
#
1010
# https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/project
1111
data "tfe_project" "tfc_project" {
12-
name = var.tfc_project_name
12+
name = var.tfc_project_name
1313
organization = var.tfc_organization_name
1414
}
1515

vault-backed/azure/tfc-workspace.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provider "tfe" {
99
#
1010
# https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/project
1111
data "tfe_project" "tfc_project" {
12-
name = var.tfc_project_name
12+
name = var.tfc_project_name
1313
organization = var.tfc_organization_name
1414
}
1515

vault-backed/gcp/tfc-workspace.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provider "tfe" {
99
#
1010
# https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/project
1111
data "tfe_project" "tfc_project" {
12-
name = var.tfc_project_name
12+
name = var.tfc_project_name
1313
organization = var.tfc_organization_name
1414
}
1515

vault/tfc-workspace.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ provider "tfe" {
99
#
1010
# https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/project
1111
data "tfe_project" "tfc_project" {
12-
name = var.tfc_project_name
12+
name = var.tfc_project_name
1313
organization = var.tfc_organization_name
1414
}
1515

0 commit comments

Comments
 (0)