Skip to content

Commit

Permalink
AAE-21637-change-regex-for-branch-name-starting-with-revert (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
revatilimaye authored Mar 29, 2024
1 parent 7c3a1c1 commit 8e52e13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/actions/enforce-pr-conventions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ runs:
fi
if [[ -z "$BRANCH_REGEX" ]]; then
echo "valid-branch-regex=^(revert-[0-9]+-)?(improvement|fix|feature|test|tmp)\/($JIRA_KEY)-[0-9]+[_-]{1}[A-Za-z0-9._-]+$" >> $GITHUB_OUTPUT
echo "valid-branch-regex=^(revert-)|(improvement|fix|feature|test|tmp)\/($JIRA_KEY)-[0-9]+[_-]{1}[A-Za-z0-9._-]+$" >> $GITHUB_OUTPUT
else
echo "valid-branch-regex=$BRANCH_REGEX" >> $GITHUB_OUTPUT
fi
if [[ -z "$PR_REGEX" ]]; then
echo "valid-pr-title-regex=^(Revert .*)|^($JIRA_KEY)-[0-9]+ [A-Z]{1}.*$" >> $GITHUB_OUTPUT
echo "valid-pr-title-regex=^(Revert*)|^($JIRA_KEY)-[0-9]+ [A-Z]{1}.*$" >> $GITHUB_OUTPUT
else
echo "valid-pr-title-regex=$PR_REGEX" >> $GITHUB_OUTPUT
fi
Expand Down
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ To exempt specific branch names from the branch name checks, the optional input

The inputs `jira-project-key`, `valid-branch-regex` and `valid-pr-title-regex` are optional: if `valid-branch-regex` or `valid-pr-title-regex` are not provided, the action will consume `jira-project-key` to generate the default regex.

**Default regex for Branch name**: `"^(revert-[0-9]+-)?(improvement|fix|feature|test|tmp)\/($JIRA_KEY)-[0-9]+[_-]{1}[A-Za-z0-9._-]+$"`
**Default regex for Branch name**: `"^(revert-)|(improvement|fix|feature|test|tmp)\/($JIRA_KEY)-[0-9]+[_-]{1}[A-Za-z0-9._-]+$"`

`(revert-[0-9]+-)` is optional and is used to match revert branches name.
If the branch name starts with `(revert-)` it will be considered valid.

Examples:

Expand All @@ -496,11 +496,11 @@ Examples:

❌ dev-uname-jkey-12345

**Default regex for PR title:**: `"^(Revert .*)|^($JIRA_KEY)-[0-9]+ [A-Z]{1}.*$"`
**Default regex for PR title:**: `"^(Revert*)|^($JIRA_KEY)-[0-9]+ [A-Z]{1}.*$"`

If the PR title starts with "Revert ", it will be considered valid.
If the PR title starts with "Revert", it will be considered valid.

If the PR title does not start with "Revert ", it will be checked against `^($JIRA_KEY)-[0-9]+ [A-Z]{1}[A-Za-z].*$` regex.
If the PR title does not start with "Revert", it will be checked against `^($JIRA_KEY)-[0-9]+ [A-Z]{1}[A-Za-z].*$` regex.

Examples:

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v5.22.0
v5.22.1

0 comments on commit 8e52e13

Please sign in to comment.