Skip to content

Commit

Permalink
fix: Update CI configuration files to use latest version (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs authored Oct 27, 2022
1 parent 222b6b0 commit 9eea3d9
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 22 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Lock Threads'

on:
schedule:
- cron: '50 1 * * *'

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-comment: >
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
issue-inactive-days: '30'
pr-comment: >
I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
pr-inactive-days: '30'
2 changes: 1 addition & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
- uses: amannn/action-semantic-pull-request@v3.4.6
- uses: amannn/action-semantic-pull-request@v5.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
directories: ${{ steps.dirs.outputs.directories }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get root directories
id: dirs
uses: clowdhaus/terraform-composite-actions/directories@v1.3.0
uses: clowdhaus/terraform-composite-actions/directories@v1.8.0

preCommitMinVersions:
name: Min TF pre-commit
Expand All @@ -32,26 +32,26 @@ jobs:
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@v1.0.3
uses: clowdhaus/terraform-min-max@v1.2.0
with:
directory: ${{ matrix.directory }}

- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
# Run only validate pre-commit check on min version supported
if: ${{ matrix.directory != '.' }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0
with:
terraform-version: ${{ steps.minMax.outputs.minVersion }}
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'

- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
# Run only validate pre-commit check on min version supported
if: ${{ matrix.directory == '.' }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0
with:
terraform-version: ${{ steps.minMax.outputs.minVersion }}
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
Expand All @@ -62,17 +62,17 @@ jobs:
needs: collectInputs
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@v1.0.3
uses: clowdhaus/terraform-min-max@v1.2.0

- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0
with:
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: github.repository_owner == 'terraform-aws-modules'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
- uses: actions/stale@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Staling issues and PR's
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.3
rev: v1.76.0
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand All @@ -23,7 +23,7 @@ repos:
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ No modules.
| [aws_iam_role_policy_attachment.additional_many](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_iam_role_policy_attachment.additional_one](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_sfn_state_machine.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sfn_state_machine) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_cloudwatch_log_group.sfn](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/cloudwatch_log_group) | data source |
| [aws_iam_policy_document.additional_inline](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module "step_function" {
}

stepfunction_Sync = {
stepfunction = ["arn:aws:states:eu-west-1:123456789012:stateMachine:test1"]
stepfunction = ["arn:aws:states:eu-west-1:123456789012:stateMachine:test1"]
stepfunction_Wildcard = ["arn:aws:states:eu-west-1:123456789012:stateMachine:test1"]

# Set to true to use the default events (otherwise, set this to a list of ARNs; see the docs linked in locals.tf
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locals {
enable_xray_tracing = try(var.service_integrations["xray"]["xray"], false) == true

# Normalize ARN by trimming ":*" because data-source has it, but resource does not have it
log_group_arn = trimsuffix(element(concat(data.aws_cloudwatch_log_group.sfn.*.arn, aws_cloudwatch_log_group.sfn.*.arn, [""]), 0), ":*")
log_group_arn = trimsuffix(try(data.aws_cloudwatch_log_group.sfn[0].arn, aws_cloudwatch_log_group.sfn[0].arn, ""), ":*")

role_name = local.create_role ? coalesce(var.role_name, var.name) : null
}
Expand Down
12 changes: 6 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Step Function
output "state_machine_id" {
description = "The ARN of the Step Function"
value = element(concat(aws_sfn_state_machine.this.*.id, [""]), 0)
value = try(aws_sfn_state_machine.this[0].id, "")
}

output "state_machine_arn" {
description = "The ARN of the Step Function"
value = element(concat(aws_sfn_state_machine.this.*.arn, [""]), 0)
value = try(aws_sfn_state_machine.this[0].arn, "")
}

output "state_machine_creation_date" {
description = "The date the Step Function was created"
value = element(concat(aws_sfn_state_machine.this.*.creation_date, [""]), 0)
value = try(aws_sfn_state_machine.this[0].creation_date, "")
}

output "state_machine_status" {
description = "The current status of the Step Function"
value = element(concat(aws_sfn_state_machine.this.*.status, [""]), 0)
value = try(aws_sfn_state_machine.this[0].status, "")
}

# IAM Role
output "role_arn" {
description = "The ARN of the IAM role created for the Step Function"
value = element(concat(aws_iam_role.this.*.arn, [""]), 0)
value = try(aws_iam_role.this[0].arn, "")
}

output "role_name" {
description = "The name of the IAM role created for the Step Function"
value = element(concat(aws_iam_role.this.*.name, [""]), 0)
value = try(aws_iam_role.this[0].name, "")
}

0 comments on commit 9eea3d9

Please sign in to comment.