Skip to content

Commit

Permalink
ci: add release-please and PR title validation (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinebayar-g authored Dec 17, 2024
1 parent 90ed89d commit 0e07244
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Lint PR

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
validate:
name: Validate PR title
runs-on: ubuntu-24.04
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
requireScope: false


- 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 require pull request titles to follow the [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 }}
```
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
18 changes: 18 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-24.04
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
26 changes: 26 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/refs/heads/main/schemas/config.json",
"release-type": "node",
"bump-minor-pre-major": true,
"changelog-sections": [
{
"type": "feat",
"hidden": false,
"section": "Features"
},
{
"type": "fix",
"hidden": false,
"section": "Bug Fixes"
},
{
"type": "chore",
"hidden": false,
"section": "Chores"
}
],
"packages": {
"packages/cli": {},
"packages/core": {}
}
}

0 comments on commit 0e07244

Please sign in to comment.