Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
open-pull-requests-limit: 25
cooldown:
default-days: 7
commit-message:
prefix: "chore"
include: "scope"
groups:
actions-minor-patch:
update-types:
- "minor"
- "patch"
patterns:
- "*"
actions-major:
update-types:
- "major"
patterns:
- "*"
9 changes: 6 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
version-template: '$MAJOR.$MINOR'
commitish: main

# Two-part Major.Minor versioning only (no patch component) — every
# non-major label bumps $MINOR, so it increments on every release
# regardless of label instead of silently accumulating in a $PATCH
# digit that version-template above wouldn't even display.
version-resolver:
major:
labels:
- 'breaking-change'
minor:
labels:
- 'type: feat'
patch:
labels:
- 'type: fix'
- 'type: docs'
- 'type: refactor'
- 'type: test'
- 'type: chore'
- 'type: ci'
- 'type: revert'
default: patch
default: minor

autolabeler:
- label: 'type: feat'
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dependabot auto-merge

on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'LayeredCraft/devops-templates'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Approve PR
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr review --approve "$PR_URL"
Comment thread
ncipollina marked this conversation as resolved.
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
Comment thread
ncipollina marked this conversation as resolved.
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/local-pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PR Title Check

on:
pull_request:
types: [opened, edited, synchronize, reopened]

permissions:
pull-requests: read
statuses: write

jobs:
validate:
uses: ./.github/workflows/pr-title-check.yml
20 changes: 20 additions & 0 deletions .github/workflows/local-release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
draft:
uses: ./.github/workflows/release-drafter.yml
with:
event_name: ${{ github.event_name }}
pr_draft: ${{ github.event.pull_request.draft == true }}
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
jobs:
validate:
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
if: github.event.pull_request.user.login != 'dependabot[bot]'

steps:
- uses: amannn/action-semantic-pull-request@v6
Expand Down