Skip to content

Commit 7449ead

Browse files
authored
Merge pull request #7 from DeNA/feature/add-github-actions
Add GitHub Actions
2 parents ff5f7ce + 2f2205c commit 7449ead

File tree

5 files changed

+168
-0
lines changed

5 files changed

+168
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Setup Terraform 🛠️"
2+
description: "Setup Terraform for infrastructure deployment"
3+
4+
inputs:
5+
tf_version:
6+
description: "specify terraform version"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Setup terraform
13+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
14+
with:
15+
terraform_version: ${{ inputs.tf_version }}

.github/pull_request_template.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## What's Changed
2+
3+
- Briefly describe what your changes do.
4+
- Link to any issue this PR addresses (e.g., "Closes #123").
5+
6+
## Why?
7+
8+
- Why are you making these changes? Any context or background info is helpful.
9+
10+
## How?
11+
12+
- Briefly explain your approach or list key changes.
13+
- Mention if there are any dependencies.
14+
15+
## How to Test
16+
17+
- Steps to test or verify the change.
18+
- Terraform version used for testing.
19+
20+
## Notes
21+
22+
- Any additional comments or things to be aware of?
23+
- Shout out if you need a specific person to review.

.github/release-drafter.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
4+
categories:
5+
- title: '🚀 Features'
6+
labels:
7+
- 'enhancement'
8+
- title: '🐛 Bug Fixes'
9+
labels:
10+
- 'bug'
11+
- 'emergency'
12+
- title: '🔧 Refactoring'
13+
label: 'refactor'
14+
- title: '📖 Documentation'
15+
label: 'documentation'
16+
- title: '✅ Tests'
17+
label: 'test'
18+
19+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
20+
21+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
22+
23+
version-resolver:
24+
major:
25+
labels:
26+
- 'major'
27+
minor:
28+
labels:
29+
- 'minor'
30+
patch:
31+
labels:
32+
- 'patch'
33+
default: patch
34+
35+
template: |
36+
## Changes
37+
$CHANGES
38+
39+
autolabeler:
40+
- label: enhancement
41+
branch:
42+
- '/^feat(ure)?[/-].+/'
43+
- label: bug
44+
branch:
45+
- '/^fix[/-].+/'
46+
- label: emergency
47+
branch:
48+
- '/^hotfix[/-].+/'
49+
- label: test
50+
branch:
51+
- '/^test[/-].+/'
52+
- label: refactor
53+
branch:
54+
- '/^refactor[/-].+/'
55+
- label: documentation
56+
branch:
57+
- '/^doc[/-].+/'

.github/workflows/create-release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create Release 🚀
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
create-release:
15+
name: Create Release 🚀
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout 🛎
21+
uses: actions/checkout@v4
22+
23+
- name: Generate Release Notes 📝
24+
id: drafter
25+
uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Format and Push Terraform Code 📝
2+
3+
env:
4+
TF_VERSION: 1.9.8
5+
6+
on:
7+
pull_request:
8+
9+
permissions:
10+
contents: "write"
11+
id-token: "write"
12+
pull-requests: "write"
13+
14+
jobs:
15+
terraform-fmt:
16+
name: Format and Push Terraform Code 📝
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
21+
steps:
22+
- name: Checkout 🛎
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.event.pull_request.head.ref }}
26+
27+
- name: Setup Terraform 🛠️
28+
uses: ./.github/actions/setup-terraform
29+
with:
30+
tf_version: ${{ env.TF_VERSION }}
31+
32+
- name: Format Terraform Code 📝
33+
run: terraform fmt -recursive
34+
35+
- name: Check the Difference
36+
id: diff
37+
run: git diff --quiet --exit-code
38+
continue-on-error: true
39+
40+
- name: Commit and Push Changes
41+
if: steps.diff.outcome == 'failure'
42+
run: |
43+
git config --global user.name "github-actions[bot]"
44+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
45+
git commit -a -m '[skip ci] format .tf files'
46+
git push

0 commit comments

Comments
 (0)