Skip to content

Commit

Permalink
Added CI workflow checks for pre-commit (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
saidsef committed Dec 17, 2022
1 parent 31f1dcf commit c528f49
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 22 deletions.
25 changes: 16 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.0
hooks:
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_validate
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_validate
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: check-yaml
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ module "gitlab_oidc" {
attach_read_only_policy = true
gitlab_organisation = "saidsef"
gitlab_repositories = [{ name = "terraform-aws-gitlab-oidc", branches = ["main", "pr-*", "*pull*", "*"] }]
gitlab_repositories = [{
name = "terraform-aws-gitlab-oidc",
branches = ["main", "pr-*", "*pull*", "*"]
}]
tags = var.tags
}
```
Expand Down
4 changes: 2 additions & 2 deletions TERRAFORM.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ No modules.

| Name | Description |
|------|-------------|
| <a name="output_repository"></a> [repository](#output\_repository) | GitLab repository and branches |
| <a name="output_repositories"></a> [repositories](#output\_repositories) | List of GitLab repositories and branches |
| <a name="output_role_arn"></a> [role\_arn](#output\_role\_arn) | AWS IAM role ARN |
| <a name="output_role_id"></a> [role\_id](#output\_role\_id) | AWS IAM role ID |
| <a name="output_thumbprint"></a> [thumbprint](#output\_thumbprint) | GitLab certificates thumbprint |
| <a name="output_thumbprint"></a> [thumbprint](#output\_thumbprint) | GitLab certificates thumbprints |
17 changes: 10 additions & 7 deletions exmaples/remote/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ module "gitlab_oidc" {
source = "saidsef/gitlab-oidc/aws"
version = ">= 1"

attach_admin_policy = true
attach_read_only_policy = true
create_oidc_provider = true
enabled = true
force_detach_policies = false
gitlab_organisation = "saidsef"
gitlab_repositories = [{ name = "terraform-aws-gitlab-oidc", branches = ["main", "pr-*", "*pull*", "*"] }]
attach_admin_policy = true
attach_read_only_policy = true
create_oidc_provider = true
enabled = true
force_detach_policies = false
gitlab_organisation = "saidsef"
gitlab_repositories = [{
name = "terraform-aws-gitlab-oidc",
branches = ["main", "pr-*", "*pull*", "*"]
}]
iam_role_name = "gitlab-runner"
iam_role_path = "/"
iam_role_permissions_boundary = ""
Expand Down
6 changes: 3 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ output "role_arn" {
description = "AWS IAM role ARN"
}

output "repository" {
output "repositories" {
value = local.repositories_branches
sensitive = false
description = "GitLab repository and branches"
description = "List of GitLab repositories and branches"
}

output "thumbprint" {
value = [for fingerprint in data.tls_certificate.provider.certificates : fingerprint.sha1_fingerprint]
sensitive = false
description = "GitLab certificates thumbprint"
description = "GitLab certificates thumbprints"
}

0 comments on commit c528f49

Please sign in to comment.