From d26bffad4a94afe58bfa1640172af3fc15e1f946 Mon Sep 17 00:00:00 2001 From: Thara Palanivel <130496890+tharapalanivel@users.noreply.github.com> Date: Thu, 13 Feb 2025 18:25:45 -0800 Subject: [PATCH 1/2] Fix workflow Signed-off-by: Thara Palanivel <130496890+tharapalanivel@users.noreply.github.com> --- .github/workflows/labelpr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/labelpr.yaml b/.github/workflows/labelpr.yaml index 14d6f226..19198360 100644 --- a/.github/workflows/labelpr.yaml +++ b/.github/workflows/labelpr.yaml @@ -17,7 +17,7 @@ jobs: const valid_pr_types = ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'build', 'ci', 'chore', 'revert']; if(context.payload.pull_request.comments === 0) { - await github.issues.createComment({ ...context.repo, issue_number: context.payload.number, body: pr_welcome_msg}); + await github.rest.issues.createComment({ ...context.repo, issue_number: context.payload.number, body: pr_welcome_msg}); } const title = context.payload.pull_request.title; @@ -32,4 +32,4 @@ jobs: const labels = context.payload.pull_request.labels; const new_labels = labels.filter(label => !valid_pr_types.includes(label.name)); // keep all labels that are not in valid_pr_types new_labels.push({name: pr_type}); - await github.issues.update({ ...context.repo, issue_number: context.payload.number, labels: new_labels }); \ No newline at end of file + await github.rest.issues.update({ ...context.repo, issue_number: context.payload.number, labels: new_labels }); \ No newline at end of file From f6279e88aa7f57e0959d56bf946451d401e74162 Mon Sep 17 00:00:00 2001 From: Thara Palanivel <130496890+tharapalanivel@users.noreply.github.com> Date: Thu, 13 Feb 2025 18:37:10 -0800 Subject: [PATCH 2/2] Delete welcome message Signed-off-by: Thara Palanivel <130496890+tharapalanivel@users.noreply.github.com> --- .github/workflows/labelpr.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/labelpr.yaml b/.github/workflows/labelpr.yaml index 19198360..5e69329b 100644 --- a/.github/workflows/labelpr.yaml +++ b/.github/workflows/labelpr.yaml @@ -12,13 +12,9 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const pr_welcome_msg = `Thanks for making a pull request! 😃\nOne of the maintainers will review and advise on the next steps.`; // https://github.com/commitizen/conventional-commit-types const valid_pr_types = ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'build', 'ci', 'chore', 'revert']; - if(context.payload.pull_request.comments === 0) { - await github.rest.issues.createComment({ ...context.repo, issue_number: context.payload.number, body: pr_welcome_msg}); - } const title = context.payload.pull_request.title; const results = /^(\w+)(\(\w+\))?!?:/.exec(title);