PR standardization#94
Conversation
There was a problem hiding this comment.
PR Complexity Score: 2.0 - Trivial
View Breakdown
- Lines Changed: 217
- Files Changed: 5
- Complexity Added: 0
- Raw Score: 19.34
⚠️ Sensitive Data Detected
| File | Types | Count | ||||||
|---|---|---|---|---|---|---|---|---|
|
| Line | Type | Preview |
|---|---|---|
| 13 | Secret: Secret Keyword | [Secret Keyword] |
High-level summary
This PR introduces standardized tooling and automation around pull requests:
- Adds a PR template to enforce consistent metadata (changelog, summary, impact, type, docs).
- Adds a script and documentation to generate changelogs from merged PRs via the GitHub API.
- Adds CI workflows for PR linting and PR size checks, including exception handling and approval gating.
Key functionalities and changes
-
PR Template
- New
.github/pull_request_template.mdto capture:- Changelog and summary
- Functional automation changes and test report URL
- Areas of impact
- Type of change (bugfix, feature, enhancement, tests, docs, chore)
- Documentation links
- New
-
Changelog generation tooling
- New
generate-changelog.shscript to:- Query GitHub’s search API for merged PRs into a given branch within a date range.
- Exclude “Parent branch sync” and bot-authored PRs.
- Handle auth via
GH_USERNAMEandGH_PATenv vars. - Validate and clean JSON responses, and print a formatted changelog plus a verification URL.
- New README explaining usage, prerequisites, arguments, and example commands.
- New
-
PR lint workflow
- New
Common PR Lintworkflow:- Triggers on PR events targeting
mainormaster(from a defined branch set). - Reuses a shared workflow from
chargebee/cb-cicd-pipelinesfor standardized lint checks.
- Triggers on PR events targeting
- New
-
PR size check workflow
- New
PR Size Checkworkflow:- Runs on PRs targeting
devordevelop/**. - Uses shared
pr-size-checkaction with thresholds (warning: 200, error: 250 lines). - Excludes certain paths (e.g.,
.github/**,.cursor/**). - Supports a
pr-size-exceptionlabel:- Posts a comment indicating pending approvals from
cb-Billing-CAB-reviewers. - Sets an environment requiring
cb-billing-reviewerswhen bypass label is present. - Ensures the job passes when bypass is active.
- Posts a comment indicating pending approvals from
- Runs on PRs targeting
- New
File-level change summary
| File | Change summary |
|---|---|
.github/pull_request_template.md |
Adds a standardized PR template capturing changelog, summary, automation status, test report URL, areas of impact, change type, and documentation links. |
.github/scripts/README.md |
Documents the new changelog generation script, including prerequisites, environment setup, usage examples, and argument behavior. |
.github/scripts/generate-changelog.sh |
New Bash script to generate a changelog by querying GitHub’s search API for merged PRs into a specified branch and date range, with error handling, JSON validation/cleanup, and formatted output plus a verification URL. |
.github/workflows/pr-lint.yml |
Introduces a reusable “Common PR Lint” GitHub Actions workflow that runs lint checks on PRs targeting main or master using a shared pipeline. |
.github/workflows/pr-size-check.yml |
Adds a “PR Size Check” workflow that enforces PR size limits on dev/develop/** branches, supports a pr-size-exception bypass label, posts approval-pending comments, and integrates with cb-billing-reviewers environment requirements. |
| ## CHANGELOG | ||
| REPLACE_ME_WITH_CHANGELOG | ||
|
|
||
| ## SUMMARY | ||
| REPLACE_ME_WITH_SUMMARY_OF_THE_CHANGES |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The top-level section is titled ## CHANGELOG, but the template body and PR description emphasize capturing both a changelog and a summary; using only "CHANGELOG" here may confuse authors about where to put a concise summary vs. detailed changelog entry.
Why: Ambiguous section naming can lead to inconsistent usage of the template, with some authors putting only a summary here and skipping the dedicated SUMMARY section, reducing the effectiveness of standardized metadata.
How to Fix: Rename the section to clearly indicate it is for the changelog entry (e.g., “Changelog Entry”) or add clarifying text so authors understand this is the line that will be copied into release notes.
| ## CHANGELOG | |
| REPLACE_ME_WITH_CHANGELOG | |
| ## SUMMARY | |
| REPLACE_ME_WITH_SUMMARY_OF_THE_CHANGES | |
| ## CHANGELOG ENTRY | |
| REPLACE_ME_WITH_CHANGELOG | |
| ## SUMMARY | |
| REPLACE_ME_WITH_SUMMARY_OF_THE_CHANGES |
| ## FUNCTIONAL AUTOMATION CHANGES PR | ||
| - [ ] Yes | ||
| - If Yes, PR : | ||
| - [ ] No | ||
| - If No, Reason: |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The “FUNCTIONAL AUTOMATION CHANGES PR” section uses nested free-text prompts (“If Yes, PR:” / “If No, Reason:”) without a clear placeholder format, which can lead to inconsistent or incomplete entries.
Why: Inconsistent formatting makes it harder to parse this information manually or via tooling, and contributors may leave these lines blank or unclear, reducing the value of the metadata.
How to Fix: Add explicit placeholders (e.g., REPLACE_ME_WITH_LINK / REPLACE_ME_WITH_REASON) or example formats so authors know exactly what to provide.
| ## FUNCTIONAL AUTOMATION CHANGES PR | |
| - [ ] Yes | |
| - If Yes, PR : | |
| - [ ] No | |
| - If No, Reason: | |
| ## FUNCTIONAL AUTOMATION CHANGES PR | |
| - [ ] Yes | |
| - If Yes, PR: REPLACE_ME_WITH_FUNCTIONAL_AUTOMATION_PR_LINK | |
| - [ ] No | |
| - If No, Reason: REPLACE_ME_WITH_REASON_FOR_NO_FUNCTIONAL_AUTOMATION_CHANGES |
| ## AUTOMATION TEST REPORT URL | ||
| REPLACE_ME_WITH_TEST_REPORT_URL |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The “AUTOMATION TEST REPORT URL” section requires a URL but does not indicate what to do when no report exists (e.g., for small changes or docs-only PRs).
Why: Lack of guidance can lead to inconsistent entries (left blank, “N/A”, or random text), which complicates automated checks or manual review expectations.
How to Fix: Update the placeholder to explicitly allow NA when no test report is applicable, aligning with the pattern used in other sections.
| ## AUTOMATION TEST REPORT URL | |
| REPLACE_ME_WITH_TEST_REPORT_URL | |
| ## AUTOMATION TEST REPORT URL | |
| REPLACE_ME_WITH_TEST_REPORT_URL_OR_NA |
| ## AREAS OF IMPACT | ||
| REPLACE_ME_WITH_AREAS_OF_IMPACT_OR_NA |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The “AREAS OF IMPACT” placeholder suggests NA but does not encourage structured entries (e.g., components, services, or modules), which can lead to vague or low-signal responses.
Why: Unstructured impact descriptions reduce the usefulness of this field for reviewers trying to quickly understand blast radius and for any future automation that might parse this section.
How to Fix: Clarify the expected format (e.g., comma-separated components or example categories) in the placeholder text.
| ## AREAS OF IMPACT | |
| REPLACE_ME_WITH_AREAS_OF_IMPACT_OR_NA | |
| ## AREAS OF IMPACT | |
| REPLACE_ME_WITH_AREAS_OF_IMPACT_EG_BILLING_API_UI_DB_OR_NA |
| ## TYPE OF CHANGE | ||
| - [ ] 🐞 Bugfix | ||
| - [ ] 🌟 Feature | ||
| - [ ] ✨ Enhancement | ||
| - [ ] 🧪 Unit Test Cases | ||
| - [ ] 📔 Documentation | ||
| - [ ] ⚙️ Chore - Build Related / Configuration / Others |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The “TYPE OF CHANGE” checklist uses emojis, which may not render consistently in all environments and can make automated parsing of change types more difficult.
Why: If future tooling needs to parse this section (e.g., for changelog generation or metrics), emojis mixed with labels can complicate reliable extraction of the selected type.
How to Fix: Keep the human-readable labels but move emojis to the end or remove them, ensuring the leading text is a clean, parseable category name.
| ## TYPE OF CHANGE | |
| - [ ] 🐞 Bugfix | |
| - [ ] 🌟 Feature | |
| - [ ] ✨ Enhancement | |
| - [ ] 🧪 Unit Test Cases | |
| - [ ] 📔 Documentation | |
| - [ ] ⚙️ Chore - Build Related / Configuration / Others | |
| ## TYPE OF CHANGE | |
| - [ ] Bugfix 🐞 | |
| - [ ] Feature 🌟 | |
| - [ ] Enhancement ✨ | |
| - [ ] Unit Test Cases 🧪 | |
| - [ ] Documentation 📔 | |
| - [ ] Chore - Build Related / Configuration / Others ⚙️ |
| ## DOCUMENTATION | ||
| REPLACE_ME_WITH_DOCUMENTATION_LINK_OR_NA No newline at end of file |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The file currently has “No newline at end of file”, which is a minor formatting issue and can cause noisy diffs or warnings in some tools.
Why: POSIX and many linters expect text files to end with a newline; missing it can lead to inconsistent behavior across editors and minor friction in future diffs.
How to Fix: Add a trailing newline at the end of the file.
| ## DOCUMENTATION | |
| REPLACE_ME_WITH_DOCUMENTATION_LINK_OR_NA | |
| ## DOCUMENTATION | |
| REPLACE_ME_WITH_DOCUMENTATION_LINK_OR_NA |
| # Optional: Branch name (defaults to current branch if not provided) | ||
| SOURCE_BRANCH="${1:-$(git branch --show-current)}" | ||
| # Optional: Date filter (defaults to last 30 days if not provided) | ||
| DATE_FILTER="${2:-merged:>=$(date -u -v-30d +%Y-%m-%d 2>/dev/null || date -u -d '30 days ago' +%Y-%m-%d)}" | ||
|
|
||
| # Repo is set per-repo when this file is pushed (placeholder replaced by upload script) | ||
| REPO="chargebee/chargebee-ios" |
There was a problem hiding this comment.
Priority: 🟡 MEDIUM
Problem: The DATE_FILTER default uses a GNU/BSD-specific date expression inline in the query string (merged:$DATE_FILTER), which can produce an invalid GitHub search query if the date command fails or behaves differently across environments.
Why: This script is likely to be run in different shells/OSes (e.g., macOS with BSD date, Linux with GNU date), and subtle differences or failures in the date invocation will result in malformed merged: filters, causing the GitHub API call to fail or return unexpected results.
How to Fix: Compute the default date in a separate variable with explicit error handling, then build DATE_FILTER as a simple string (merged:>=YYYY-MM-DD), ensuring the query is always well-formed and easier to debug.
| # Optional: Branch name (defaults to current branch if not provided) | |
| SOURCE_BRANCH="${1:-$(git branch --show-current)}" | |
| # Optional: Date filter (defaults to last 30 days if not provided) | |
| DATE_FILTER="${2:-merged:>=$(date -u -v-30d +%Y-%m-%d 2>/dev/null || date -u -d '30 days ago' +%Y-%m-%d)}" | |
| # Repo is set per-repo when this file is pushed (placeholder replaced by upload script) | |
| REPO="chargebee/chargebee-ios" | |
| # Optional: Branch name (defaults to current branch if not provided) | |
| SOURCE_BRANCH="${1:-$(git branch --show-current)}" | |
| # Optional: Date filter (defaults to last 30 days if not provided) | |
| if [[ -z "$2" ]]; then | |
| DEFAULT_DATE=$(date -u -v-30d +%Y-%m-%d 2>/dev/null || date -u -d '30 days ago' +%Y-%m-%d) | |
| DATE_FILTER="merged:>=$DEFAULT_DATE" | |
| else | |
| DATE_FILTER="$2" | |
| fi | |
| # Repo is set per-repo when this file is pushed (placeholder replaced by upload script) | |
| REPO="chargebee/chargebee-ios" |
| HTTP_STATUS=$(curl -s -w "%{http_code}" -G -u "$GH_USERNAME:$GH_PAT" \ | ||
| "https://api.github.com/search/issues" \ | ||
| --data-urlencode "q=NOT \"Parent branch sync\" in:title is:pr repo:$REPO is:merged base:$SOURCE_BRANCH merged:$DATE_FILTER -author:app/distributed-gitflow-app" \ | ||
| -o /tmp/curl_output.json \ | ||
| 2>/tmp/curl_error.log) |
There was a problem hiding this comment.
Priority: 🟡 MEDIUM
Problem: The GitHub search query uses merged:$DATE_FILTER even though DATE_FILTER already includes the merged: prefix, resulting in a duplicated merged: segment (e.g., merged:merged:>=2024-02-10) when the default is used.
Why: A malformed merged: filter can cause the GitHub API to ignore the intended date constraint or return an error, leading to incorrect or empty changelog results.
How to Fix: Pass DATE_FILTER directly into the query without prepending merged:, and ensure DATE_FILTER is constructed as a complete filter string (e.g., merged:>=YYYY-MM-DD).
| HTTP_STATUS=$(curl -s -w "%{http_code}" -G -u "$GH_USERNAME:$GH_PAT" \ | |
| "https://api.github.com/search/issues" \ | |
| --data-urlencode "q=NOT \"Parent branch sync\" in:title is:pr repo:$REPO is:merged base:$SOURCE_BRANCH merged:$DATE_FILTER -author:app/distributed-gitflow-app" \ | |
| -o /tmp/curl_output.json \ | |
| 2>/tmp/curl_error.log) | |
| HTTP_STATUS=$(curl -s -w "%{http_code}" -G -u "$GH_USERNAME:$GH_PAT" \ | |
| "https://api.github.com/search/issues" \ | |
| --data-urlencode "q=NOT \"Parent branch sync\" in:title is:pr repo:$REPO is:merged base:$SOURCE_BRANCH $DATE_FILTER -author:app/distributed-gitflow-app" \ | |
| -o /tmp/curl_output.json \ | |
| 2>/tmp/curl_error.log) |
| echo "==============================================================================" | ||
| echo -e "Found ${GREEN}$PR_MERGED_COUNT${NOCOLOR} PR(s) merged into $SOURCE_BRANCH (filter: $DATE_FILTER)" | ||
| echo "==============================================================================" | ||
| echo -e "## ${GREEN}CHANGELOG${NOCOLOR}" | ||
| echo "$PR_LIST_RESPONSE" | jq -r '.items[] | (.title) + " (" + (.user.login) + ") [#" + (.number | tostring) + "]"' | sort | ||
| printf "\n" |
There was a problem hiding this comment.
Priority: 🟡 MEDIUM
Problem: The script pipes .items[] into jq without guarding against the case where .items is empty or missing, which will cause jq to exit with a non-zero status and terminate the script due to set -e.
Why: When no PRs match the search criteria, jq -r '.items[] | ...' fails with “Cannot iterate over null (null)” and, under set -e, the script will exit abruptly instead of gracefully reporting that no PRs were found.
How to Fix: Check PR_MERGED_COUNT before iterating, and only run the jq pipeline when the count is greater than zero; otherwise, print a friendly message and continue.
| echo "==============================================================================" | |
| echo -e "Found ${GREEN}$PR_MERGED_COUNT${NOCOLOR} PR(s) merged into $SOURCE_BRANCH (filter: $DATE_FILTER)" | |
| echo "==============================================================================" | |
| echo -e "## ${GREEN}CHANGELOG${NOCOLOR}" | |
| echo "$PR_LIST_RESPONSE" | jq -r '.items[] | (.title) + " (" + (.user.login) + ") [#" + (.number | tostring) + "]"' | sort | |
| printf "\n" | |
| echo "==============================================================================" | |
| echo -e "Found ${GREEN}$PR_MERGED_COUNT${NOCOLOR} PR(s) merged into $SOURCE_BRANCH (filter: $DATE_FILTER)" | |
| echo "==============================================================================" | |
| echo -e "## ${GREEN}CHANGELOG${NOCOLOR}" | |
| if [ "$PR_MERGED_COUNT" -gt 0 ]; then | |
| echo "$PR_LIST_RESPONSE" | jq -r '.items[] | (.title) + " (" + (.user.login) + ") [#" + (.number | tostring) + "]"' | sort | |
| else | |
| echo "No merged PRs found for the given branch and date filter." | |
| fi | |
| printf "\n" |
| echo "==============================================================================" | ||
| echo -e "${GREEN}GitHub Search URL (to verify, if required)${NOCOLOR}" | ||
| BRANCH_ENCODED=$(echo "$SOURCE_BRANCH" | sed 's/ /%20/g') | ||
| echo "https://github.com/$REPO/pulls?q=NOT+%22Parent+branch+sync%22+in%3Atitle+is%3Apr+is%3Amerged+base%3A$BRANCH_ENCODED+merged%3A$DATE_FILTER+-author%3Aapp%2Fdistributed-gitflow-app" | ||
| echo "==============================================================================" |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The manual URL construction only encodes spaces in SOURCE_BRANCH and leaves DATE_FILTER unencoded, which can break the verification URL if the filter contains characters that need URL encoding (e.g., : or >).
Why: While GitHub’s web UI is forgiving, unencoded special characters in query parameters can lead to incorrect parsing or require manual fixing by the user, reducing the reliability of the “verification URL” feature.
How to Fix: URL-encode both the branch and the full query string (or at least the dynamic parts) before interpolating them into the URL, using sed or python -c 'import urllib.parse; ...' to ensure proper encoding.
| echo "==============================================================================" | |
| echo -e "${GREEN}GitHub Search URL (to verify, if required)${NOCOLOR}" | |
| BRANCH_ENCODED=$(echo "$SOURCE_BRANCH" | sed 's/ /%20/g') | |
| echo "https://github.com/$REPO/pulls?q=NOT+%22Parent+branch+sync%22+in%3Atitle+is%3Apr+is%3Amerged+base%3A$BRANCH_ENCODED+merged%3A$DATE_FILTER+-author%3Aapp%2Fdistributed-gitflow-app" | |
| echo "==============================================================================" | |
| echo "==============================================================================" | |
| echo -e "${GREEN}GitHub Search URL (to verify, if required)${NOCOLOR}" | |
| BRANCH_ENCODED=$(echo "$SOURCE_BRANCH" | sed 's/ /%20/g') | |
| DATE_FILTER_ENCODED=$(echo "$DATE_FILTER" | sed 's/:/%3A/g; s/>/%3E/g; s/ /+/g') | |
| echo "https://github.com/$REPO/pulls?q=NOT+%22Parent+branch+sync%22+in%3Atitle+is%3Apr+is%3Amerged+base%3A$BRANCH_ENCODED+$DATE_FILTER_ENCODED+-author%3Aapp%2Fdistributed-gitflow-app" | |
| echo "==============================================================================" |
| on: | ||
| pull_request: | ||
| branches: [master, main,staging, dev,develop] | ||
| types: [ready_for_review, reopened, review_requested, review_request_removed, opened, edited] |
There was a problem hiding this comment.
Priority: 🟡 MEDIUM
Problem: The branches list in the pull_request trigger is missing spaces after some commas (main,staging, dev,develop), which is inconsistent and can reduce readability/maintainability of the workflow configuration.
Why: While GitHub Actions accepts this syntax, inconsistent formatting makes the workflow harder to scan and increases the chance of subtle mistakes when branches are added/edited later.
How to Fix: Add spaces after all commas in the branches array to keep the list consistently formatted and easier to maintain.
| on: | |
| pull_request: | |
| branches: [master, main,staging, dev,develop] | |
| types: [ready_for_review, reopened, review_requested, review_request_removed, opened, edited] | |
| on: | |
| pull_request: | |
| branches: [master, main, staging, dev, develop] | |
| types: [ready_for_review, reopened, review_requested, review_request_removed, opened, edited] |
| jobs: | ||
| pr-lint: | ||
| name: Common PR Lint Checks | ||
| if: github.base_ref == 'main' || github.base_ref == 'master' | ||
| uses: chargebee/cb-cicd-pipelines/.github/workflows/pr-lint.yml@main |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: The if condition restricts the job to run only when the base branch is main or master, even though the workflow is triggered for PRs targeting staging, dev, and develop as well.
Why: This mismatch between the trigger branches and the conditional execution can be confusing for maintainers and may lead to incorrect assumptions that lint checks run on all configured branches when they actually do not.
How to Fix: Either narrow the pull_request.branches list to only main and master, or expand the if condition to include the additional branches you intend to support (e.g., staging, dev, develop), depending on the desired behavior.
| jobs: | |
| pr-lint: | |
| name: Common PR Lint Checks | |
| if: github.base_ref == 'main' || github.base_ref == 'master' | |
| uses: chargebee/cb-cicd-pipelines/.github/workflows/pr-lint.yml@main | |
| jobs: | |
| pr-lint: | |
| name: Common PR Lint Checks | |
| if: github.base_ref == 'main' || github.base_ref == 'master' || github.base_ref == 'staging' || github.base_ref == 'dev' || startsWith(github.base_ref, 'develop') | |
| uses: chargebee/cb-cicd-pipelines/.github/workflows/pr-lint.yml@main |
| env: | ||
| BYPASS_LABEL: pr-size-exception | ||
| environment: ${{ contains(github.event.pull_request.labels.*.name, 'pr-size-exception') && 'cb-billing-reviewers' || '' }} | ||
| steps: | ||
| - uses: chargebee/cb-cicd-pipelines/.github/actions/pr-size-check@v4.20.3 |
There was a problem hiding this comment.
Priority: 🟠 HIGH
Problem: The environment value is conditionally set to an empty string when the bypass label is absent, which is not a valid environment name and can cause the workflow/job to fail or behave unpredictably.
Why: GitHub Actions expects environment to be either omitted or set to a valid environment name; providing an empty string may result in runtime errors or misconfiguration of environment protection rules, undermining the intended approval gating behavior.
How to Fix: Only set the environment field when the pr-size-exception label is present by using a conditional expression that returns null instead of an empty string, which GitHub Actions treats as “not set.”
| env: | |
| BYPASS_LABEL: pr-size-exception | |
| environment: ${{ contains(github.event.pull_request.labels.*.name, 'pr-size-exception') && 'cb-billing-reviewers' || '' }} | |
| steps: | |
| - uses: chargebee/cb-cicd-pipelines/.github/actions/pr-size-check@v4.20.3 | |
| env: | |
| BYPASS_LABEL: pr-size-exception | |
| environment: ${{ contains(github.event.pull_request.labels.*.name, 'pr-size-exception') && 'cb-billing-reviewers' || null }} | |
| steps: | |
| - uses: chargebee/cb-cicd-pipelines/.github/actions/pr-size-check@v4.20.3 |
| steps: | ||
| - uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const owner = context.repo.owner; | ||
| const repo = context.repo.repo; | ||
| const issue_number = context.payload.pull_request.number; | ||
|
|
||
| const marker = '<!-- pr-size-bypass-pending -->'; | ||
| const pending = `${marker} | ||
| 🛑 The \`pr-size-exception\` label is present. This workflow is **waiting for approvals** from the **[cb-Billing-CAB-reviewers](https://github.com/orgs/chargebee/teams/cb-billing-cab-approvers)**.`; | ||
|
|
||
| // create a new comment when the workflow runs | ||
| await github.rest.issues.createComment({ owner, repo, issue_number, body: pending }); |
There was a problem hiding this comment.
Priority: 🟡 MEDIUM
Problem: The pre-approval-comment job posts a new “pending bypass approval” comment on every run when the label is present, leading to duplicate comments and potential noise on the PR.
Why: Repeated identical comments can clutter the PR discussion, make it harder for reviewers to find relevant information, and may annoy contributors; this is especially likely because the workflow triggers on multiple PR events (synchronize, edited, labeled, unlabeled).
How to Fix: Before creating a new comment, query existing comments on the PR and only post if a comment containing the marker (<!-- pr-size-bypass-pending -->) does not already exist.
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const issue_number = context.payload.pull_request.number; | |
| const marker = '<!-- pr-size-bypass-pending -->'; | |
| const pending = `${marker} | |
| 🛑 The \`pr-size-exception\` label is present. This workflow is **waiting for approvals** from the **[cb-Billing-CAB-reviewers](https://github.com/orgs/chargebee/teams/cb-billing-cab-approvers)**.`; | |
| // create a new comment when the workflow runs | |
| await github.rest.issues.createComment({ owner, repo, issue_number, body: pending }); | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const issue_number = context.payload.pull_request.number; | |
| const marker = '<!-- pr-size-bypass-pending -->'; | |
| const pending = `${marker} | |
| 🛑 The \`pr-size-exception\` label is present. This workflow is **waiting for approvals** from the **[cb-Billing-CAB-reviewers](https://github.com/orgs/chargebee/teams/cb-billing-cab-approvers)**.`; | |
| // Avoid posting duplicate comments with the same marker | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner, | |
| repo, | |
| issue_number, | |
| per_page: 100, | |
| }); | |
| const alreadyPosted = comments.some(comment => comment.body && comment.body.includes(marker)); | |
| if (!alreadyPosted) { | |
| await github.rest.issues.createComment({ owner, repo, issue_number, body: pending }); | |
| } |
| excludePaths: | | ||
| .github/** | ||
| .cursor/** | ||
|
|
||
|
|
||
| - name: Ensure required check passes when bypassed |
There was a problem hiding this comment.
Priority: 🟢 LOW
Problem: There are two trailing blank lines within the excludePaths block, which are unnecessary and slightly reduce readability of the workflow file.
Why: While this does not affect functionality, extra blank lines inside YAML blocks can make the configuration look untidy and may confuse future editors about whether additional values are intended.
How to Fix: Remove the redundant blank lines so that the excludePaths list ends cleanly after the last intended path.
| excludePaths: | | |
| .github/** | |
| .cursor/** | |
| - name: Ensure required check passes when bypassed | |
| excludePaths: | | |
| .github/** | |
| .cursor/** | |
| - name: Ensure required check passes when bypassed |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This PR adds standardized PR template, changelog script, PR lint workflow, and PR size check workflow.