feat: unified view for saved and more payment methods screen #2957
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Conventional Commit Message Check | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- edited | |
- reopened | |
- ready_for_review | |
- synchronize | |
merge_group: | |
types: | |
- checks_requested | |
permissions: | |
pull-requests: write | |
jobs: | |
pr_title_check: | |
name: Verify PR title follows conventional commit standards | |
runs-on: ubuntu-latest | |
steps: | |
- name: Verify PR title follows conventional commit standards | |
id: pr_title_check | |
if: ${{ github.event_name == 'pull_request_target' }} | |
uses: actions/github-script@v7 | |
continue-on-error: true | |
env: | |
PR_TITLE: ${{ github.event.pull_request.title }} | |
with: | |
script: | | |
const title = process.env.PR_TITLE; | |
const conventionalCommitRegex = /^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert|release)(\(.+\))?!?: .+/; | |
if (!conventionalCommitRegex.test(title)) { | |
core.setFailed(`PR title "${title}" does not follow conventional commit format. | |
Expected format: type(scope): description | |
Valid types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert, release | |
Examples: | |
- feat: add new user authentication | |
- fix(auth): resolve login redirect issue | |
- docs: update API documentation | |
- feat!: breaking change to user API | |
- release: vX.XXX.XX`); | |
return false; | |
} | |
console.log(`✅ PR title "${title}" follows conventional commit format`); | |
return true; | |
- name: Verify commit message follows conventional commit standards | |
id: commit_message_check | |
if: ${{ github.event_name == 'merge_group' }} | |
uses: actions/github-script@v7 | |
continue-on-error: false | |
env: | |
COMMIT_MESSAGE: ${{ github.event.merge_group.head_commit.message }} | |
with: | |
script: | | |
const message = process.env.COMMIT_MESSAGE; | |
const conventionalCommitRegex = /^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert|release)(\(.+\))?!?: .+/; | |
if (!conventionalCommitRegex.test(message)) { | |
core.setFailed(`Commit message "${message}" does not follow conventional commit format. | |
Expected format: type(scope): description | |
Valid types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert, release | |
Examples: | |
- release: v0.125.0`); | |
return false; | |
} | |
console.log(`✅ Commit message follows conventional commit format`); | |
return true; | |
- name: Attach 'S-conventions-not-followed' label if PR title check failed | |
if: ${{ github.event_name == 'pull_request_target' && steps.pr_title_check.outcome == 'failure' }} | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --add-label 'S-conventions-not-followed' | |
echo "::error::PR title does not follow conventional commit standards" | |
exit 1 | |
- name: Remove 'S-conventions-not-followed' label if PR title check succeeded | |
if: ${{ github.event_name == 'pull_request_target' && steps.pr_title_check.outcome == 'success' }} | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --remove-label 'S-conventions-not-followed' |