Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add branch to merge_group on action #77

Merged
merged 24 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/commit_message_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ jobs:

If there is no jira releated to this change, please put 'Jira: NO-JIRA'.

Desciption can be changed by editing the top comment on your pull request and making a new commit.
84 changes: 52 additions & 32 deletions .github/workflows/commit_message_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ name: commit-message-format

# Controls when the workflow will run
on:
# Triggers the workflow on a merge queue
merge_group:
# Triggers the workflow on pull request to master branch
pull_request:
branches: [ "master", "rdkcentral:master" ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -34,41 +35,60 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
# Check PR description for 'Summery:' field.
- name: Match 'Summery:'
uses: actions-ecosystem/action-regex-match@v2
id: summery-match
if: failure() || success()
with:
token: ${{ secrets.GITHUB_TOKEN }}
text: ${{ github.event.pull_request.body }}
regex: 'Summery:\s*[\s\S]*?'
flags: gm

- name: Check required Summery field
if: ${{ success() || failure() }}
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
- name: Check 'Summery:'
if: (failure() || success()) && (steps.summery-match.outputs.match == '')
run: exit 1

# Check PR description for 'Type: Feature|Fix|Cleanup' field.
- name: Match 'Type:'
uses: actions-ecosystem/action-regex-match@v2
id: type-match
if: failure() || success()
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '\nSummery:\s*[\s\S]*?'
error: "Require a 'Summery:' field"

- name: Check required Type field
if: ${{ success() || failure() }}
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '\nType:\s*Feature|Fix|Cleanup'
error: "Require a 'Type: Feature/Fix/Cleanup' field"
text: ${{ github.event.pull_request.body }}
regex: 'Type:\s*Feature|Fix|Cleanup'

- name: Check required Test Plan field
if: ${{ success() || failure() }}
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
- name: Check 'Type:'
if: (failure() || success()) && (steps.type-match.outputs.match == '')
run: exit 1

# Check PR description for 'Test Plan:' field.
- name: Match 'Test Plan:'
uses: actions-ecosystem/action-regex-match@v2
id: test-plan-match
if: failure() || success()
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '\nTest Plan:\s*[\s\S]*?'
error: "Require a 'Test Plan:' field"
text: ${{ github.event.pull_request.body }}
regex: 'Test Plan:\s*[\s\S]*?'

- name: Check required Jira field
if: ${{ success() || failure() }}
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
- name: Check 'Test Plan:'
if: (failure() || success()) && (steps.test-plan-match.outputs.match == '')
run: exit 1

# Check PR description for 'Jira:' field.
- name: Match 'Jira:'
uses: actions-ecosystem/action-regex-match@v2
id: jira-match
if: failure() || success()
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '\nJira:\s*[\s\S]*?'
error: "Require a 'Jira:' field, if no jira put 'Jira: NO-JIRA'"
text: ${{ github.event.pull_request.body }}
regex: 'Jira:\s*[\s\S]*?'

- name: Check 'Jira:'
if: (failure() || success()) && (steps.jira-match.outputs.match == '')
run: exit 1

# Print description.
- name: Log string on failure
if: failure()
run: echo ${{ github.event.pull_request.body }}
Loading