Skip to content

Commit b2c95ab

Browse files
fix: update README for clarity and versioning guidance
1 parent ae67a40 commit b2c95ab

1 file changed

Lines changed: 34 additions & 8 deletions

File tree

README.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GitHub Action coping Terraform variables across modules
1+
# GitHub Action copying Terraform variables across modules
22
**GitHub Action automatically copying variables' definitions from a single file to many modules.**
33

44

@@ -8,17 +8,17 @@
88

99

1010
## ✨ Features
11-
* It's main use will be everywhere where [Terraform](https://github.com/hashicorp/terraform) is used with *more than one module in a **monorepo***.
11+
* Its main use will be everywhere where [Terraform](https://github.com/hashicorp/terraform) is used with *more than one module in a **monorepo***.
1212
* Reads file defined with `all_vars_file` and will use whole definitions of variables from it.
1313
* For every module matching `dirs_with_modules` will search files matching `files_with_vars` and replace matching variables from `all_vars_file`.
14-
* To not loose the changes combine with my other action [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push).
14+
* To not lose the changes combine with my other action [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push).
1515

1616

1717
## 🔗 Related Actions
1818
**Perfect for automation workflows and integrates seamlessly with [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push).**
1919

2020

21-
## Badge swag
21+
## 📊 Badges
2222
[
2323
![GitHub repo](https://img.shields.io/badge/GitHub-devops--infra%2Faction--terraform--copy--vars-blueviolet.svg?style=plastic&logo=github)
2424
![GitHub last commit](https://img.shields.io/github/last-commit/devops-infra/action-terraform-copy-vars?color=blueviolet&logo=github&style=plastic&label=Last%20commit)
@@ -75,7 +75,7 @@ jobs:
7575
terraform-copy-vars:
7676
runs-on: ubuntu-latest
7777
steps:
78-
- name: Checkout repoistory
78+
- name: Checkout repository
7979
uses: actions/checkout@v5
8080
8181
- name: Fail on different variables' definitions
@@ -87,14 +87,14 @@ jobs:
8787
### 🔀 Advanced Example
8888
Copy variables definitions from `all-variables.tf` to all `variables.tf` in `modules` subdirectories and commit updated files back to the repository using my other action [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push).
8989
```yaml
90-
name: Copy Terraform variables accross modules
90+
name: Copy Terraform variables across modules
9191
on:
9292
push
9393
jobs:
9494
terraform-copy-vars:
9595
runs-on: ubuntu-latest
9696
steps:
97-
- name: Checkout repoistory
97+
- name: Checkout repository
9898
uses: actions/checkout@v5
9999
100100
- name: Update Terraform variables
@@ -105,13 +105,39 @@ jobs:
105105
all_vars_file: all-variables.tf
106106
107107
- name: Commit changes to repo
108-
uses: devops-infra/action-commit-push@master
108+
uses: devops-infra/action-commit-push@v1
109109
with:
110110
github_token: ${{ secrets.GITHUB_TOKEN }}
111111
commit_prefix: "[AUTO-VARIABLES]"
112112
```
113113

114114

115+
### 🎯 Use specific version
116+
Pick the tag level based on your stability needs:
117+
- `vX.Y.Z`: exact immutable release (most predictable)
118+
- `vX.Y`: latest patch within one minor line
119+
- `vX`: latest patch within one major line
120+
121+
```yaml
122+
name: Use pinned action version
123+
on: [push]
124+
jobs:
125+
terraform-copy-vars:
126+
runs-on: ubuntu-latest
127+
steps:
128+
- uses: actions/checkout@v5
129+
130+
- uses: devops-infra/action-terraform-copy-vars@v1.0.1
131+
id: pin-patch
132+
133+
- uses: devops-infra/action-terraform-copy-vars@v1.0
134+
id: pin-minor
135+
136+
- uses: devops-infra/action-terraform-copy-vars@v1
137+
id: pin-major
138+
```
139+
140+
115141
## 🤝 Contributing
116142
Contributions are welcome! See [CONTRIBUTING](https://github.com/devops-infra/.github/blob/master/CONTRIBUTING.md).
117143
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)