diff --git a/.github/workflows/card-validation.yaml b/.github/workflows/card-validation.yaml index 071f57c..c3e5496 100644 --- a/.github/workflows/card-validation.yaml +++ b/.github/workflows/card-validation.yaml @@ -41,9 +41,10 @@ jobs: repo: context.repo.repo, issue_number: context.issue.number, body: "**Validation Failed!** \n\n" + - "The branch name and PR title must follow the `TADocs-` pattern.\n" + - "- Ensure the branch name starts with `TADocs-`.\n" + - "- Ensure the PR title contains `TADocs-`.\n\n" + + + "The branch name and PR title must follow the `ATOM-PJT-` pattern.\n" + + "- Ensure the branch name starts with `ATOM-PJT-`.\n" + + "- Ensure the PR title contains `ATOM-PJT-`.\n\n" + "Please adjust and try again. Thank you!" }); console.log(`Comment added: ${comment.html_url}`); diff --git a/scripts/validate_pr.py b/scripts/validate_pr.py index 823da4b..164f748 100644 --- a/scripts/validate_pr.py +++ b/scripts/validate_pr.py @@ -2,26 +2,27 @@ def validate_branch_and_pr_title(branch, pr_title): """ - Validates if the branch name and PR title follow the 'TADocs-' pattern. + Validates if the branch name and PR title follow the 'ATOM-PJT-' pattern. Args: branch (str): The name of the branch to validate. pr_title (str): The title of the pull request (PR) to validate. Returns: - bool: True if both the branch and the pull request follow the 'TADocs-' pattern, False otherwise. + bool: True if both the branch and the pull request follow the 'ATOM-PJT-' pattern, False otherwise. Prints: str: A message indicating whether the branch and PR title are valid or specifying the validation error. """ - # Verify if the branch starts with 'TADocs-' - if not branch.startswith("TADocs-"): - print(f"The branch '{branch}' does not start with the pattern 'TADocs-'.") + + # Verify if the branch starts with 'ATOM-PJT-' + if not branch.startswith("ATOM-PJT-"): + print(f"The branch '{branch}' does not start with the pattern 'ATOM-PJT-'.") return False - # Verify if the branch contains with 'TADocs-' - if "TADocs-" not in pr_title: - print(f"The PR title '{pr_title}' does not contain the pattern 'TADocs-'.") + # Verify if the branch contains with 'ATOM-PJT-' + if "ATOM-PJT-" not in pr_title: + print(f"The PR title '{pr_title}' does not contain the pattern 'ATOM-PJT-'.") return False - print(f"Validation successful: The branch '{branch}' and the PR title '{pr_title}' follow the 'TADocs-' pattern.") + print(f"Validation successful: The branch '{branch}' and the PR title '{pr_title}' follow the 'ATOM-PJT-' pattern.") return True