Skip to content

Commit 1578ea9

Browse files
committed
feat(conventional-commits): update workflow to validate PR titles against Conventional Commits
1 parent 381d39c commit 1578ea9

File tree

3 files changed

+44
-10
lines changed

3 files changed

+44
-10
lines changed
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
name: Conventional Commits
1+
name: "Lint PR"
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
4+
workflow_call:
5+
secrets:
6+
GITHUB_TOKEN:
7+
required: true
78

89
jobs:
9-
build:
10-
name: Conventional Commits
10+
validate-pr-title:
11+
name: Validate PR title
1112
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: read
1215
steps:
13-
- uses: actions/checkout@v4
14-
15-
- uses: webiny/[email protected]
16+
- uses: amannn/action-semantic-pull-request@v5
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ This workflow builds a Docker image from a Dockerfile. It is a reusable workflow
1111
This workflow uses the [release-please-action](https://github.com/googleapis/release-please-action) to automate the release of a project.
1212

1313
### [Publish NPM Package](./publish-npm)
14-
This workflow publishes an NPM package to the NPM registry.
14+
This workflow publishes an NPM package to the NPM registry.
15+
16+
### [Conventional Commits](./conventional-commits)
17+
This workflow checks that pull request titles follow the [Conventional Commits](https://www.conventionalcommits.org/) specification.

conventional-commits/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Conventional Commits
2+
3+
This workflow checks that pull request titles follow the [Conventional Commits](https://www.conventionalcommits.org/) specification.
4+
5+
## Secrets
6+
7+
### `GITHUB_TOKEN`
8+
9+
**Required** The GitHub token to use for authentication.
10+
11+
## Example usage
12+
13+
```yaml
14+
name: Lint PR Title
15+
16+
on:
17+
pull_request_target:
18+
types:
19+
- opened
20+
- edited
21+
- reopened
22+
23+
jobs:
24+
lint-pr-title:
25+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
26+
secrets:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
```

0 commit comments

Comments
 (0)