Skip to content

Commit

Permalink
chore: update action conventional commits
Browse files Browse the repository at this point in the history
feat: update action conventional commits
ING-3232
  • Loading branch information
emanuelaepure10 committed Mar 6, 2024
1 parent d7789f9 commit 036dd03
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 20 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/action-conventional-commits-taskmedia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://github.com/taskmedia/action-conventional-commits/tree/main
name: Action Conventional Commits Taskmedia

on:
push:
branches:
- main

jobs:
build:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: taskmedia/[email protected]
with:
# token to access GitHub API to receive PR commits
# Default: ${{ github.token }}
token: ${{ secrets.GITHUB_TOKEN }}

# skip merge commits
# Default: true
skip_merge: ""

# skip revert commits
# Default: true
skip_revert: ""

# allow different types in commit message
# Default: fix|feat|revert
types: "feat|fix|docs|style|refactor|perf|test|chore"
3 changes: 2 additions & 1 deletion .github/workflows/action-conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://github.com/webiny/action-conventional-commits
name: Action Conventional Commits

on:
Expand All @@ -15,4 +16,4 @@ jobs:
- uses: webiny/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Optional, for private repositories.
allowed-commit-types: "feat,fix" # Optional, set if you want a subset of commit types to be allowed.
allowed-commit-types: "feat,fix,docs,style,refactor,perf,test,chore" # Optional, set if you want a subset of commit types to be allowed.
17 changes: 17 additions & 0 deletions .github/workflows/check-commit-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://github.com/marketplace/actions/check-commit-message
name: Check Commit Message

on:
push:
branches:
- main

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Check commit 🧪
uses: adityaa30/check-commit@master
20 changes: 20 additions & 0 deletions .github/workflows/commit-quality-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# https://github.com/marketplace/actions/commit-quality-checker
name: Beams Commit Message Checker

on:
push:
branches:
- main

jobs:
check-commit-message:
runs-on: ubuntu-latest
name: Check commit message
permissions:
pull-requests: write # required to post pull request comments
contents: read # required to read commit information
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check commit message
uses: actions/[email protected]
6 changes: 4 additions & 2 deletions .github/workflows/commit_message.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Check Commit Message
# custom commit checker

name: Check Commit Message CUSTOM

on:
push:
Expand All @@ -16,7 +18,7 @@ jobs:
- name: Check commit message
run: |
COMMIT_MSG=$(git log --format=%B -n 1 ${{ github.sha }})
PATTERN_MSG='^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .{1,100}$'
PATTERN_MSG='^(fixup! )?(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .{1,100}$'
if [[ ! $COMMIT_MSG =~ $PATTERN_MSG ]]; then
echo "Invalid commit message format. Must match pattern: /^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .{1,100}$/"
exit 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
name: Commitlint

on:
Expand Down
25 changes: 8 additions & 17 deletions .github/workflows/gs-commit-message-checker.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://github.com/marketplace/actions/gs-commit-message-checker?version=v2.0.0
name: 'GS Commit Message Checker'
on:
pull_request:
Expand All @@ -19,26 +20,16 @@ on:

jobs:
check-commit-message:
name: Check Commit Message
name: GS Commit Message Checker
runs-on: ubuntu-latest
steps:
- name: Check Commit Type
uses: gsactions/commit-message-checker@v1
with:
pattern: '^.+(feat|fix|docs|style|refactor|perf|test|chore): .+$'
flags: 'gm'
error: 'Your first line has to contain a commit type like "feat: your_title".'
- name: Check Line Length
- name: Check for Resolves / Fixes
uses: gsactions/commit-message-checker@v1
with:
pattern: '^[^#].{74}'
error: 'The maximum line length of 74 characters is exceeded.'
excludeDescription: 'true' # optional: this excludes the description body of a pull request
excludeTitle: 'true' # optional: this excludes the title of a pull request
checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request
accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true
- name: Check for Resolves / Fixes
pattern: '^.+(ING)\-[0-9]+$'
error: 'You need at least one "ING-<issue number>" line.'
- name: Check Commit Type
uses: gsactions/commit-message-checker@v1
with:
pattern: '^.+(feat|fix|docs|style|refactor|perf|test|chore): \#[0-9]+$'
error: 'You need at least one "feat|fix|docs|style|refactor|perf|test|chore: #<issue number>" line.'
pattern: '^.+(feat|fix|docs|style|refactor|perf|test|chore): .+$'
error: 'Your first line has to contain a commit type like "feat: your_title".'

0 comments on commit 036dd03

Please sign in to comment.