Skip to content

Commit

Permalink
feat: update pr title check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 committed Nov 29, 2023
1 parent e943185 commit 9a20e39
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/conventional-commit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# Since we only label pull requests, do not have a checkout step in this
# workflow, and restrict permissions on the token, this is an acceptable
# use of this trigger.
pull_request:
pull_request_target:
types:
- opened
- edited
Expand Down Expand Up @@ -51,6 +51,7 @@ jobs:

- name: Verify PR title follows conventional commit standards
id: pr_title_check
if: ${{ github.event_name == 'pull_request_target' }}
shell: bash
env:
TITLE: ${{ github.event.pull_request.title }}
Expand All @@ -67,7 +68,7 @@ jobs:

# GitHub CLI returns a successful error code even if the PR has the label already attached
- name: Attach 'S-conventions-not-followed' label if PR title check failed
if: ${{ steps.pr_title_check.outcome == 'failure' }}
if: ${{ github.event_name == 'pull_request_target' && steps.pr_title_check.outcome == 'failure' }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -78,7 +79,7 @@ jobs:
# GitHub CLI returns a successful error code even if the PR does not have the label attached
- name: Remove 'S-conventions-not-followed' label if PR title check succeeded
if: ${{ steps.pr_title_check.outcome == 'success' }}
if: ${{ github.event_name == 'pull_request_target' && steps.pr_title_check.outcome == 'success' }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
Expand Down

0 comments on commit 9a20e39

Please sign in to comment.