Skip to content

Commit

Permalink
Refactor GitHub workflows for automerge and renovate
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonfire1119 committed Apr 28, 2024
1 parent 00e9b53 commit 3137960
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/renovate-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const description = context.payload.pull_request.body;
const majorRegex = /\b(major)\b/i; // Regular expression to find "major" in the PR description
if (majorRegex.test(description)) {
const body = context.payload.pull_request.body;
// Regex to find markdown table rows and check if any have 'major' in the Update column
const regex = /(?<=\|\s\[)(?:[^\]]+\]\(https?:\/\/[^\s\)]+\)\s\|\s)(major)(?=\s\|)/gi;
const isMajorUpdate = regex.test(body);
if (isMajorUpdate) {
console.log("Found a major version bump.");
core.setOutput("automerge", "false");
} else {
Expand Down

0 comments on commit 3137960

Please sign in to comment.