Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit c91ce35

Browse files
authored
Revert "Refactor into single GitHub Action (#86)" (#87)
This reverts commit 3747f30.
1 parent 3747f30 commit c91ce35

File tree

38 files changed

+95
-951
lines changed

38 files changed

+95
-951
lines changed

CHANGELOG.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,23 @@
11
# Terraform GitHub Actions
2+
These official Terraform GitHub Actions allow you to run `terraform fmt`, `validate`, `plan` and `apply` on your pull requests to help you review, validate and apply Terraform changes.
23

3-
Terraform GitHub Actions allow you to run Terraform commands within GitHub Actions.
4+
## Getting Started
5+
To get started, check out our documentation: [https://www.terraform.io/docs/github-actions/getting-started/](https://www.terraform.io/docs/github-actions/getting-started/).
46

5-
The output of the actions can be viewed from the Actions tab in the main repository view. If the actions are executed on a `pull_request` event, a comment may be posted on the pull request.
7+
## Actions
68

7-
## Success Criteria
9+
### Fmt Action
10+
Runs `terraform fmt` and comments back if any files are not formatted correctly.
11+
<img src="./assets/fmt.png" alt="Terraform Fmt Action" width="80%" />
812

9-
An exit code of `0` is considered a successful execution.
13+
### Validate Action
14+
Runs `terraform validate` and comments back on error.
15+
<img src="./assets/validate.png" alt="Terraform Validate Action" width="80%" />
1016

11-
## Usage
17+
### Plan Action
18+
Runs `terraform plan` and comments back with the output.
19+
<img src="./assets/plan.png" alt="Terraform Plan Action" width="80%" />
1220

13-
Please refer to the examples within the `examples` directory for usage.
14-
15-
## Inputs
16-
17-
| Name | Required | Default | Description |
18-
|--------------------------|----------|---------|---------------------------------------------|
19-
| `tf_actions_version` | `true` | | Terraform version to install. |
20-
| `tf_actions_subcommand` | `true` | | Terraform subcommand to execute. |
21-
| `tf_actions_working_dir` | `false` | `.` | Terraform working directory. |
22-
| `tf_actions_comment` | `false` | `true` | Whether or not to comment on pull requests. |
23-
24-
## Outputs
25-
26-
| Name | Description |
27-
|-------------------------------|------------------------------------------------------|
28-
| `tf_actions_plan_has_changes` | Whether or not the Terraform plan contained changes. |
29-
30-
## Secrets
31-
32-
| Name | Description |
33-
|--------------------------|----------------------------------------------------------------------------------------------------------------------|
34-
| `GITHUB_TOKEN` | The GitHub API token used to post comments to pull requests. Not required if `tf_actions_comment` is set to `false`. |
35-
36-
Other secrets may be needed to authenticate with Terraform backends and providers.
37-
38-
**WARNING:** These secrets could be exposed if the action is executed on a malicious Terraform file. To avoid this, it is recommended to not use this action on public repos or repos where untrusted users can submit pull requests.
39-
40-
## Environment Variables
41-
42-
The usual [Terraform environment variables](https://www.terraform.io/docs/commands/environment-variables.html) are supported. Here are the environments variables that might be the most beneficial.
43-
44-
* [`TF_LOG`](https://www.terraform.io/docs/commands/environment-variables.html#tf_log)
45-
* [`TF_VAR_name`](https://www.terraform.io/docs/commands/environment-variables.html#tf_var_name)
46-
* [`TF_CLI_ARGS`](https://www.terraform.io/docs/commands/environment-variables.html#tf_cli_args-and-tf_cli_args_name)
47-
* [`TF_CLI_ARGS_name`](https://www.terraform.io/docs/commands/environment-variables.html#tf_cli_args-and-tf_cli_args_name)
48-
* `TF_WORKSPACE`
49-
50-
Other environment variables may be configured to pass data into Terraform backends and providers. If the data is sensitive, consider using [secrets](#secrets) instead.
21+
### Apply Action
22+
Runs `terraform apply` and comments back with the output.
23+
<img src="./assets/apply.png" alt="Terraform Apply Action" width="80%" />

action.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

apply/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Terraform Apply Action
2+
Runs `terraform apply` and comments back on the pull request with the apply output.
3+
4+
See [https://www.terraform.io/docs/github-actions/actions/apply.html](https://www.terraform.io/docs/github-actions/actions/apply.html).

assets/apply.png

32.8 KB
Loading

assets/fmt.png

73.8 KB
Loading

assets/plan.png

133 KB
Loading

assets/validate.png

51.5 KB
Loading

base-branch-filter/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM alpine:latest
2+
3+
LABEL "com.github.actions.name"="base branch filter"
4+
LABEL "com.github.actions.description"="Filters pull request events based on their base branch."
5+
LABEL "com.github.actions.icon"="filter"
6+
LABEL "com.github.actions.color"="purple"
7+
8+
LABEL "repository"="https://github.com/hashicorp/terraform-github-actions"
9+
LABEL "homepage"="http://github.com/hashicorp/terraform-github-actions"
10+
LABEL "maintainer"="HashiCorp Terraform Team <[email protected]>"
11+
12+
RUN apk --no-cache add jq
13+
14+
COPY entrypoint.sh /entrypoint.sh
15+
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)