Skip to content

Commit

Permalink
Linting and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stv-io committed Nov 15, 2023
1 parent 1ca7aaa commit 80cce4b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: ibiqlik/action-yamllint@v3
- uses: articulate/actions-markdownlint@v1

test-terraform-version-file:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -31,8 +37,9 @@ jobs:
- uses: actions/checkout@v4
- uses: ./
- name: run tfswitch with the version in an env var
env:
TF_VERSION: 1.6.2
run: |
export TF_VERSION=1.6.1
tfswitch 1.6.2
terraform --version
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
# action-tfswitch

A github action to run tfswitch as a composite action
A github action to run [tfswitch](https://tfswitch.warrensbox.com/) as a [composite action](https://github.com/orgs/community/discussions/36861)

## Usage

To use tfswtich github action, configure a YAML workflow file, e.g.
To use tfswitch github action, configure a YAML workflow file, e.g.
`.github/workflows/tfswitch.yml`, with the following:

```yaml
name: Run terraform
name: Install terraform via tfswitch

on:
- pull_request

jobs:
terraform:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Render terraform docs inside the README.md and push changes back to PR branch
- name: Setup tfswitch
uses: stv-io/action-tfswitch@main
- name: Render terraform docs inside the README.md and push changes back to PR branch
- name: Install
run: |
export TF_VERSION=1.6.1
tfswitch 1.6.2
tfswitch 1.6.4
terraform --version
terraform init
...
```
## Credit
<https://github.com/warrensbox/terraform-switcher>
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'tfswitch'
name: tfswitch'

description: 'Setup tfswitch to install a specific version of terraform'

Expand All @@ -13,7 +13,6 @@ runs:
exit 1
- name: Install tfswitch
shell: bash
id: install
run: |
echo "Downloading install script .."
curl -sLo install.sh https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
Expand Down

0 comments on commit 80cce4b

Please sign in to comment.