Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updated and formatted github actions #6

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/check_tf_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Check if terraform docs are updated
on: pull_request
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Check if terraform docs inside the README.md are updated
uses: terraform-docs/gh-actions@v1.0.0
with:
working-dir: .
fail-on-diff: true
18 changes: 0 additions & 18 deletions .github/workflows/generate_tf_docs.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/pull_request_labels.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Pull Request Labels

on: pull_request

jobs:
size-label:
runs-on: ubuntu-latest
Expand All @@ -14,7 +12,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORED: "README.md\nLICENSE\n.gitignore\n.github/**\n"

pr-labeler:
runs-on: ubuntu-latest
permissions:
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
name: Linting and formatting tests

on: pull_request

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
# with:
# terraform_version: 1.4.2

uses: hashicorp/setup-terraform@v3
- name: Terraform Init
id: init
run: terraform init

- name: Terraform Format
id: fmt
run: terraform fmt -check

- name: Terraform Validate
id: validate
run: terraform validate -no-color

- name: Comment PR
if: (steps.init.outcome == 'failure' || steps.fmt.outcome == 'failure' || steps.validate.outcome == 'failure') && github.event_name == 'pull_request'
if: (steps.init.outcome == 'failure' || steps.fmt.outcome == 'failure' || steps.validate.outcome == 'failure') &&
github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
pr_number: ${{ github.event.pull_request.number }}
comment_tag: test-chart
message: |
message: |-
# :x: Terraform Linting, Formatting or Init Failed

#### Terraform Initialization \`${{ steps.init.outcome }}\`
Expand Down
Loading