forked from minamijoyo/tfmigrate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5eb2a01
commit 917c224
Showing
7 changed files
with
237 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
labels: | ||
- bot/merge | ||
commit-message: | ||
prefix: "chore: " | ||
groups: | ||
terraform: | ||
patterns: | ||
- "github.com/hashicorp/*" | ||
gomod: | ||
patterns: | ||
- "*" | ||
exclude-patterns: | ||
- "github.com/hashicorp/*" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: | ||
- bot/merge | ||
commit-message: | ||
prefix: "chore: " | ||
groups: | ||
github-actions: | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Validates PR title follows conventional commits | ||
on: | ||
pull_request: | ||
types: | ||
- edited | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
conventional_commit_title: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
# source https://github.com/chanzuckerberg/github-actions/blob/cac0ba177b109becac01bc340a3a1547feb40fe5/.github/actions/conventional-commits/action.yml | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const validator = /^(chore|feat|fix|revert|docs|style)(\(((PLAT-[0-9]+)|([a-z-]+))\))?(!)?: (.)+$/ | ||
const title = context.payload.pull_request.title | ||
const is_valid = validator.test(title) | ||
if (!is_valid) { | ||
const details = JSON.stringify({ | ||
title: title, | ||
valid_syntax: validator.toString(), | ||
}) | ||
core.setFailed(`Your pr title doesn't adhere to conventional commits syntax. See more details: ${details}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# ref: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#common-dependabot-automations | ||
name: Dependabot auto-approve | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
# required to set pr to auto merge | ||
pull-requests: write | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-22.04 | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
- name: Set to Auto Merge | ||
run: | | ||
gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{ secrets.VINCENT_PAT }} | ||
- name: Approve PR | ||
run: | | ||
gh pr review --approve "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{ secrets.VINCENT_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
name: release-please | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v6 | ||
id: configure-changelog | ||
with: | ||
result-encoding: string | ||
script: | | ||
const changelogTypes = [ | ||
{type: "feat", section: "Features", hidden: false}, | ||
{type: "chore", section: "Misc", hidden: false}, | ||
{type: "fix", section: "BugFixes", hidden: false}, | ||
] | ||
return JSON.stringify(changelogTypes) | ||
- name: release please | ||
uses: google-github-actions/release-please-action@v3.7.12 | ||
id: release | ||
with: | ||
release-type: simple | ||
bump-minor-pre-major: true | ||
changelog-types: ${{ steps.configure-changelog.outputs.result }} | ||
# https://github.com/google-github-actions/release-please-action#github-credentials | ||
token: ${{ secrets.VINCENT_PAT }} | ||
|
||
- uses: actions/checkout@v4 | ||
# we need to fetch all history and tags | ||
# so we build the proper version | ||
with: | ||
fetch-depth: 0 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: ".go-version" | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.VINCENT_PAT }} | ||
if: ${{ steps.release.outputs.release_created }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.