Skip to content

Commit

Permalink
Merge pull request #8 from Dirrk/release/v1.0.3
Browse files Browse the repository at this point in the history
fix: release action failed
  • Loading branch information
Dirrk authored Jan 7, 2020
2 parents 2d482e1 + acc1939 commit 15c084d
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/meta.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
major_version: 1
version: 1.0.2
version: 1.0.3
14 changes: 0 additions & 14 deletions .github/workflows/pr-labeler.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/pre-release.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
name: Generate terraform docs
name: Pull Request actions
on:
- pull_request
jobs:
docs:

label:
name: 'PR Labeler'
if: github.event.action == 'opened'
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v3
with:
configuration-path: .github/pr-labeler.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

fmt:
name: 'Terraform fmt'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: fmt
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_working_dir: examples
tf_actions_version: '0.12.17'
tf_actions_subcommand: 'fmt'
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
name: 'Build example docs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -53,3 +83,19 @@ jobs:
tf_docs_output_file: README.md
tf_docs_git_push: 'true'
tf_docs_git_commit_message: 'terraform-docs: automated action'

release:
name: 'Release'
needs: build
if: startsWith(github.event.pull_request.head.ref, 'release')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Generate files for release
uses: ./
with:
entrypoint: "/pre-release.sh"
22 changes: 0 additions & 22 deletions .github/workflows/terraform_fmt.yml

This file was deleted.

17 changes: 4 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
<a name="unreleased"></a>
## [Unreleased]

<a name="v1.0.3"></a>
## [v1.0.3] - 2020-01-06
### Chore
- automated generate readme
- automated release process

### Features
- added auto major tag
- Added pre-release and release scripts
- added pr template
- Added images to docs
- Add release draft action
- Updated example documentation
- on semvar tag also update the major tag


<a name="v1.0.2"></a>
## [v1.0.2] - 2020-01-07
Expand All @@ -30,6 +21,6 @@
## v1.0.0 - 2020-01-02


[Unreleased]: https://github.com/Dirrk/terraform-docs/compare/v1.0.2...HEAD
[v1.0.3]: https://github.com/Dirrk/terraform-docs/compare/v1.0.2...v1.0.3
[v1.0.2]: https://github.com/Dirrk/terraform-docs/compare/v1.0.1...v1.0.2
[v1.0.1]: https://github.com/Dirrk/terraform-docs/compare/v1.0.0...v1.0.1
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM derekrada/terraform-docs:v1.0.2
FROM derekrada/terraform-docs:v1.0.3
COPY ./src/common.sh /common.sh
COPY ./src/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./src/generate-readme.sh /generate-readme.sh
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# terraform-docs
A Github action for generating terraform module documentation using terraform-docs and gomplate. In addition to statically defined directory modules, this module can search specific sub folders or parse atlantis.yaml for module identification and doc generation. This action has the ability to auto commit docs to an open PR or after a push to a specific branch.
## Version
v1.0.2
v1.0.3

Supported and tested on terraform version 0.11+ & 0.12+ but may work for others.

Expand All @@ -20,7 +20,7 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}

- name: Render terraform docs inside the USAGE.md and push changes back to PR branch
uses: Dirrk/terraform-docs@v1.0.2
uses: Dirrk/terraform-docs@v1.0.3
with:
tf_docs_working_dir: .
tf_docs_output_file: USAGE.md
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
## Simple / Single folder
```
- name: Generate TF Docs
uses: Dirrk/terraform-docs@v1.0.2
uses: Dirrk/terraform-docs@v1.0.3
with:
tf_docs_working_dir: .
tf_docs_output_file: README.md
Expand All @@ -124,17 +124,17 @@ jobs:
## Use atlantis.yaml v3 to find all dirs
```
- name: Generate TF docs
uses: Dirrk/terraform-docs@v1.0.2
uses: Dirrk/terraform-docs@v1.0.3
with:
tf_docs_atlantis_file: atlantis.yaml
```
## Find all .tf file folders under a given directory
```yaml
- name: Generate TF docs
uses: Dirrk/terraform-docs@v1.0.2
uses: Dirrk/terraform-docs@v1.0.3
with:
tf_docs_find_dir: examples/
```

Complete examples can be found [here](https://github.com/Dirrk/terraform-docs/tree/v1.0.2/examples)
Complete examples can be found [here](https://github.com/Dirrk/terraform-docs/tree/v1.0.3/examples)
2 changes: 1 addition & 1 deletion src/generate-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

. /common.sh

export INPUT_TF_DOCS_GIT_COMMIT_MESSAGE="chore: automated generate readme"
export INPUT_TF_DOCS_GIT_COMMIT_MESSAGE="skip: automated generate readme"
cd $GITHUB_WORKSPACE
git_setup

Expand Down
2 changes: 1 addition & 1 deletion src/pre-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

. /common.sh

export INPUT_TF_DOCS_GIT_COMMIT_MESSAGE="chore: automated release process"
export INPUT_TF_DOCS_GIT_COMMIT_MESSAGE="skip: automated release process"
cd $GITHUB_WORKSPACE
git_setup

Expand Down
2 changes: 1 addition & 1 deletion src/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export INPUT_TF_DOCS_GIT_COMMIT_MESSAGE="chore: automated release process"
cd $GITHUB_WORKSPACE
git_setup

VERSION=`gomplate -d meta=.github/meta.yml 'v{{ (ds "meta").major_version }}'`
VERSION=`gomplate -d meta=.github/meta.yml -i 'v{{ (ds "meta").major_version }}'`
git tag -f "${VERSION}"
git push -f --tags

0 comments on commit 15c084d

Please sign in to comment.