From 94127bb8af0fdd7a0283a552af2b6a4750610d70 Mon Sep 17 00:00:00 2001 From: Ace <40604284+AceTheCreator@users.noreply.github.com> Date: Tue, 31 Jan 2023 14:13:33 +0100 Subject: [PATCH] chore: update release branch (#901) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sergio Moya <1083296+smoya@users.noreply.github.com> Co-authored-by: Tenshi Codes <116377630+codingtenshi@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: asyncapi-bot Co-authored-by: Fran Méndez Co-authored-by: Animesh Kumar Co-authored-by: Lukasz Gornicki Co-authored-by: Maciej Urbańczyk Co-authored-by: Vladimír Gorej --- .../workflows/add-good-first-issue-labels.yml | 29 ++++++++++--------- .../scripts/mailchimp/package-lock.json | 12 ++++++++ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/add-good-first-issue-labels.yml b/.github/workflows/add-good-first-issue-labels.yml index 202345269..57db82262 100644 --- a/.github/workflows/add-good-first-issue-labels.yml +++ b/.github/workflows/add-good-first-issue-labels.yml @@ -4,27 +4,28 @@ # Purpose of this workflow is to enable anyone to label issue with 'Good First Issue' and 'area/*' with a single command. name: Add 'Good First Issue' and 'area/*' labels # if proper comment added -on: - issue_comment: - types: - - created +on: + issue_comment: + types: + - created jobs: add-labels: - if: ${{!github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot'}} + if: ${{(!github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot') && (contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' ))}} runs-on: ubuntu-latest steps: - name: Add label - if: contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' ) uses: actions/github-script@v5 with: github-token: ${{ secrets.GH_TOKEN }} script: | const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design']; - const values = context.payload.comment.body.trim().split(" "); - switch(values[1]){ + const words = context.payload.comment.body.trim().split(" "); + const areaIndex = words.findIndex((word)=> word === '/gfi' || word === '/good-first-issue') + 1 + let area = words[areaIndex]; + switch(area){ case 'ts': - values[1] = 'typescript'; + area = 'typescript'; break; case 'js': values[1] = 'javascript'; @@ -33,7 +34,7 @@ jobs: values[1] = 'docs'; break; } - if(values.length != 2 || !areas.includes(values[1])){ + if(!areas.includes(area)){ const message = `Hey @${context.payload.sender.login}, your message doesn't follow the requirements, you can try \`/help\`.` await github.rest.issues.createComment({ @@ -44,14 +45,14 @@ jobs: }) } else { - //remove complexity and areas if there are any before adding new labels; + // remove area if there is any before adding new labels. const currentLabels = (await github.rest.issues.listLabelsOnIssue({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, })).data.map(label => label.name); - const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(values[1]))); + const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(area)); shouldBeRemoved.forEach(label => { github.rest.issues.deleteLabel({ owner: context.repo.owner, @@ -60,11 +61,11 @@ jobs: }); }); - //add new labels + // Add new labels. github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: ['good first issue', `area/${values[1]}`] + labels: ['good first issue', `area/${area}`] }); } diff --git a/.github/workflows/scripts/mailchimp/package-lock.json b/.github/workflows/scripts/mailchimp/package-lock.json index e7f570381..fc182c7bd 100644 --- a/.github/workflows/scripts/mailchimp/package-lock.json +++ b/.github/workflows/scripts/mailchimp/package-lock.json @@ -74,9 +74,15 @@ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "node_modules/cookiejar": { +<<<<<<< HEAD "version": "2.1.3", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" +======= + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==" +>>>>>>> 8087feec522e2685172c0ccd729a4d2abc7f1360 }, "node_modules/core-util-is": { "version": "1.0.3", @@ -397,9 +403,15 @@ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "cookiejar": { +<<<<<<< HEAD "version": "2.1.3", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" +======= + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==" +>>>>>>> 8087feec522e2685172c0ccd729a4d2abc7f1360 }, "core-util-is": { "version": "1.0.3",