Skip to content

Commit

Permalink
feat(ci): Add a bunch of boilerplate automation goodies (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaikaN57 authored Jan 18, 2025
1 parent e7d1745 commit a3cbb54
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/nextdoor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
slackChannel: "#kingpin"
21 changes: 21 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name-template: v$RESOLVED_VERSION
tag-template: 'v$RESOLVED_VERSION'
tag-prefix: 'v'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: |
## Changes
$CHANGES
77 changes: 77 additions & 0 deletions .github/workflows/prlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: pull-request-lint
on:
pull_request:
types:
- edited
- labeled
- opened
- ready_for_review
- reopened
- synchronize
branches-ignore:
- production
jobs:
validate:
name: Validate PR title
runs-on:
- runs-on=${{ github.run_id }}
- runner=1cpu-linux-arm64
- extras=s3-cache
permissions:
contents: read
pull-requests: write
steps:
# Magic Cache
- uses: runs-on/action@v1

# Check out the repo so that we can dynamically discover the available charts in the repo.
- name: Checkout
uses: actions/checkout@v4
# Verify the PR title against the "types" and "scopes" we allow.
#
# https://github.com/amannn/action-semantic-pull-request#configuration
- uses: amannn/[email protected]
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: true
types: |
chore
docs
feat
fix
refactor
test
scopes: |
deps
docs
ci
actors
aws
s3
iam
cfn
cloudformation
group
macro
- uses: marocchino/sticky-pull-request-comment@v2
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
We have changed the repository requirements to now use [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
9 changes: 9 additions & 0 deletions .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: release-drafter
on:
push:
branches:
- main
jobs:
drafter:
uses: Nextdoor/.github/.github/workflows/release-drafter.yml@main
secrets: inherit
24 changes: 24 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# https://github.com/marketplace/actions/stale-branches
name: Stale Branches

on:
workflow_dispatch: {}
schedule:
- cron: '0 6 * * 1-5'

permissions:
issues: write
contents: write
pull-requests: write

jobs:
stale_branches:
runs-on: ubuntu-latest
steps:
- name: Stale Branches
uses: crs-k/[email protected]
with:
days-before-stale: 21
days-before-delete: 28
tag-committer: true
branches-filter-regex: '^((?!dependabot|production))'
28 changes: 28 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":prHourlyLimitNone",
":prConcurrentLimitNone",
":automergePr",
":automergePatch",
":automergeRequireAllStatusChecks"
],
"automerge": true,
"automergeType": "pr",
"platformAutomerge": true,
"schedule": [
"before 5am on monday"
],
"packageRules": [
{
"matchUpdateTypes": [ "patch", "minor" ],
"automerge": true
},
{
"enabled": false,
"matchDatasources": [ "docker" ],
"matchPackageNames": [ "library/" ]
}
]
}

0 comments on commit a3cbb54

Please sign in to comment.