Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
posquit0 committed Sep 26, 2023
0 parents commit 53619c6
Show file tree
Hide file tree
Showing 17 changed files with 812 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[*.{tf,tfvars}]
indent_size = 2
indent_style = space

[*.md]
max_line_length = 0

[COMMIT_EDITMSG]
max_line_length = 0
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @posquit0
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
3 changes: 3 additions & 0 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Modules
":floppy_disk: sfn-state-machine":
- modules/sfn-state-machine/**/*
45 changes: 45 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Warning
- color: "ee0701"
description: "Categorize bug reports."
name: ":warning: bug"
- color: "ee0701"
description: "Categorize vulnerability reports."
name: ":warning: vulnerability"

# Highlight
- color: "0e8a16"
description: "Good for newcomers."
name: ":fire: good first issue"
- color: "0e8a16"
description: "Extra attention is needed."
name: ":fire: help wanted"

# Cancel
- color: "b60205"
description: "This issue or pull request already exists."
name: ":pray: duplicate"
- color: "b60205"
description: "This will not be worked on."
name: ":pray: wontfix"

# Size
- color: "cfd3d7"
description: "Extra Small size issue or PR."
name: "size/XS"
- color: "cfd3d7"
description: "Small size issue or PR."
name: "size/S"
- color: "cfd3d7"
description: "Medium size issue or PR."
name: "size/M"
- color: "cfd3d7"
description: "Large size issue or PR."
name: "size/L"
- color: "cfd3d7"
description: "Extra Large size issue or PR."
name: "size/XL"

# Modules
- color: "fbca04"
description: "This issue or pull request is related to sfn-state-machine module."
name: ":floppy_disk: sfn-state-machine"
34 changes: 34 additions & 0 deletions .github/workflows/pull-request-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Label Pull Requests

on:
- pull_request_target

jobs:
label-pr:
runs-on: ubuntu-latest

steps:
- name: Add Labels for PR
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yaml
sync-labels: true

- name: Add PR Size Labels for PR
uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
xs_max_size: '20'
s_label: 'size/S'
s_max_size: '50'
m_label: 'size/M'
m_max_size: '150'
l_label: 'size/L'
l_max_size: '300'
xl_label: 'size/XL'
fail_if_xl: 'false'
message_if_xl: >
'This PR has too many changes.
Please make sure you are NOT addressing multiple issues with one PR.'
26 changes: 26 additions & 0 deletions .github/workflows/sync-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Sync labels

on:
push:
branches:
- main
paths:
- .github/labels.yaml
workflow_dispatch: {}

jobs:
sync-labels:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Sync labels
uses: crazy-max/ghaction-github-labeler@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yaml
skip-delete: false
dry-run: false
# exclude: |
108 changes: 108 additions & 0 deletions .github/workflows/terraform.integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Integration (Terraform)

on:
push:
branches:
- main
pull_request: {}

concurrency:
group: terraform-integration-${{ github.ref }}
cancel-in-progress: true

jobs:
changed:
name: Filter Changed Files and Directories
runs-on: ubuntu-latest

outputs:
changed: ${{ steps.set-outputs.outputs.changed }}
modified: ${{ steps.set-outputs.outputs.modified }}
changed_files: ${{ steps.set-outputs.outputs.changed_files }}
modified_files: ${{ steps.set-outputs.outputs.modified_files }}
changed_directories: ${{ steps.set-outputs.outputs.changed_directories }}
modified_directories: ${{ steps.set-outputs.outputs.modified_directories }}

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v38
with:
files: |
modules/**
examples/**
json: true

- name: Get Changed Directories
id: changed-directories
uses: tj-actions/changed-files@v38
with:
files: |
modules/**
examples/**
dir_names: "true"
dir_names_max_depth: 2
json: true

- name: Set outputs
id: set-outputs
run: |
echo "changed=${{ steps.changed-directories.outputs.any_changed }}" >> $GITHUB_OUTPUT
echo "modified=${{ steps.changed-directories.outputs.any_modified }}" >> $GITHUB_OUTPUT
echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
echo "modified_files=${{ steps.changed-files.outputs.all_modified_files }}" >> $GITHUB_OUTPUT
echo "changed_directories=${{ steps.changed-directories.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
echo "modified_directories=${{ steps.changed-directories.outputs.all_modified_files }}" >> $GITHUB_OUTPUT
terraform:
name: Lint (terraform)
needs:
- changed
if: ${{ needs.changed.outputs.modified == 'true' }}
uses: tedilabs/.github/.github/workflows/terraform.terraform.yaml@main

strategy:
matrix:
path: ${{ fromJson(needs.changed.outputs.modified_directories) }}

with:
terraform_target_dir: ${{ matrix.path }}
terraform_version: latest
terraform_host: app.terraform.io
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
terraform_token: ${{ secrets.TERRAFORM_TOKEN }}


tflint:
name: Lint (tflint)
needs:
- changed
if: ${{ needs.changed.outputs.modified == 'true' }}
uses: tedilabs/.github/.github/workflows/terraform.tflint.yaml@main

strategy:
matrix:
path: ${{ fromJson(needs.changed.outputs.modified_directories) }}

with:
tflint_version: latest
tflint_config_file: .tflint.hcl
tflint_target_dir: ${{ matrix.path }}
tflint_recursive_enabled: false
tflint_terraform_init_enabled: true
terraform_version: latest
terraform_host: app.terraform.io
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
terraform_token: ${{ secrets.TERRAFORM_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/welcome.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Welcome for First Issue or Pull Request

on:
pull_request_target:
types:
- opened
issues:
types:
- opened

jobs:
welcome:
runs-on: ubuntu-latest

steps:
- name: Welcome for First Issue or Pull Request
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
### :wave: Welcome! Looks like this is your first issue.
Hey, thanks for your contribution! Please give us a bit of time to review it. 😄
**Be sure to follow the issue template!**
pr-message: |
### :wave: Welcome! Looks like this is your first pull request.
Hey, thanks for your contribution! Please give us a bit of time to review it. 😄
**Please check out our contributing guidelines.**
60 changes: 60 additions & 0 deletions .github/workflows/yaml.integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Integration (YAML)

on:
push:
branches:
- main
pull_request: {}

concurrency:
group: yaml-integration-${{ github.ref }}
cancel-in-progress: true

jobs:
changed:
name: Filter Changed Files and Directories
runs-on: ubuntu-latest

outputs:
changed: ${{ steps.set-outputs.outputs.changed }}
modified: ${{ steps.set-outputs.outputs.modified }}
changed_files: ${{ steps.set-outputs.outputs.changed_files }}
modified_files: ${{ steps.set-outputs.outputs.modified_files }}

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v38
with:
files: |
**/*.yaml
**/*.yml
json: true

- name: Set outputs
id: set-outputs
run: |
echo "changed=${{ steps.changed-files.outputs.any_changed }}" >> $GITHUB_OUTPUT
echo "modified=${{ steps.changed-files.outputs.any_modified }}" >> $GITHUB_OUTPUT
echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
echo "modified_files=${{ steps.changed-files.outputs.all_modified_files }}" >> $GITHUB_OUTPUT
lint:
name: Lint (yamllint)
needs:
- changed
if: ${{ needs.changed.outputs.modified == 'true' }}
uses: tedilabs/.github/.github/workflows/yaml.yamllint.yaml@main

with:
yamllint_version: latest
yamllint_config_file: .yamllint.yaml
yamllint_target_dir: ./
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 53619c6

Please sign in to comment.