Skip to content

Commit

Permalink
fix(platform/bitbucket): remove interactive text in issue should be r…
Browse files Browse the repository at this point in the history
…ead only (#21409)
  • Loading branch information
PhilipAbed committed Apr 10, 2023
1 parent b23700d commit 80c3725
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/modules/platform/utils/__fixtures__/issue-body.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.
- [ ] <!-- unlimit-branch=renovate/ansi-regex-6.x -->Update dependency ansi-regex to v6
- [ ] <!-- unlimit-branch=renovate/commander-10.x -->Update dependency commander to v10
- [ ] <!-- unlimit-branch=renovate/graceful-fs-4.x -->Update dependency graceful-fs to v4
- [ ] <!-- create-all-rate-limited-prs -->🔐 **Create all rate-limited PRs at once** 🔐

## Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Expand Down
7 changes: 7 additions & 0 deletions lib/modules/platform/utils/read-only-issue-body.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@ describe('modules/platform/utils/read-only-issue-body', () => {
)
);
});

it('removes the create-all-rate-limited-prs', () => {
const s = readOnlyIssueBody(issueBody);
expect(s).toEqual(
expect.not.stringMatching('Create all rate-limited PRs at once')
);
});
});
});
3 changes: 2 additions & 1 deletion lib/modules/platform/utils/read-only-issue-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export function readOnlyIssueBody(body: string): string {
.replace(' To discard all commits and start over, click on a checkbox.', '')
.replace(regEx(/ Click (?:on |)a checkbox.*\./g), '')
.replace(regEx(/\[ ] <!-- \w*-branch.*-->/g), '')
.replace(regEx(/- \[ ] <!-- rebase-all-open-prs -->.*/g), '');
.replace(regEx(/- \[ ] <!-- rebase-all-open-prs -->.*/g), '')
.replace(regEx(/ - \[ ] <!-- create-all-rate-limited-prs -->.*/g), '');
}

export default readOnlyIssueBody;

0 comments on commit 80c3725

Please sign in to comment.