From e22fb6be529ea3422d6c0ed2ec3b4008750c0e7e Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 29 Jan 2024 19:32:57 +0100 Subject: [PATCH 01/19] fix: update @asyncapi/parser to 3.0.3 version (#55) --- library/package-lock.json | 16 ++++++++-------- library/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index 2083b11..4a91a6f 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/parser": "^3.0.0", + "@asyncapi/parser": "^3.0.3", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", @@ -65,11 +65,11 @@ } }, "node_modules/@asyncapi/parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0.tgz", - "integrity": "sha512-DvPAt4pk7V4D5rTGTrMKOfqRQ1qTzf5CuGecFW+mxAIuKd8XyTT5kPPKTbDnAdFAVk1l7YjPIySE7t9xLaEjKw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.3.tgz", + "integrity": "sha512-nRkzgzcSkqBMy6kL/AWNsL8EJzDePFI4x6949V+4R/zYtbAm1IYY9Q4DEc81pnxoWHrJrVvrSD6O73/VTJ+XoA==", "dependencies": { - "@asyncapi/specs": "^6.0.0", + "@asyncapi/specs": "^6.2.1", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -173,9 +173,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0.tgz", - "integrity": "sha512-/HikjNcrTR/OgZmXWHYkdLdoJQUm80zcM5dnr1dx2R92WRmMQ0wweEJyFXCZwwyzoRkPHMD3RU4h3ppM8pYHRQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.2.1.tgz", + "integrity": "sha512-rfd0bzJrApEbxYD4U1SUG02GGG6lK6i6lup9LDWpVu1QwwuMNLAgf8+jsmsf3e7OinB/lauxRumGODXCxBu5Jw==", "dependencies": { "@types/json-schema": "^7.0.11" } diff --git a/library/package.json b/library/package.json index 62e8dc9..03f4354 100644 --- a/library/package.json +++ b/library/package.json @@ -49,7 +49,7 @@ "get:version": "echo $npm_package_version" }, "dependencies": { - "@asyncapi/parser": "^3.0.0", + "@asyncapi/parser": "^3.0.3", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", From 471e38d1d7943368afbff1a50633bdde0a1e9d1a Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 30 Jan 2024 05:47:20 +0100 Subject: [PATCH 02/19] fix: update @asyncapi/parser to 3.0.4 version (#56) --- library/package-lock.json | 16 ++++++++-------- library/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index 4a91a6f..2a2f8d0 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/parser": "^3.0.3", + "@asyncapi/parser": "^3.0.4", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", @@ -65,11 +65,11 @@ } }, "node_modules/@asyncapi/parser": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.3.tgz", - "integrity": "sha512-nRkzgzcSkqBMy6kL/AWNsL8EJzDePFI4x6949V+4R/zYtbAm1IYY9Q4DEc81pnxoWHrJrVvrSD6O73/VTJ+XoA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.4.tgz", + "integrity": "sha512-xop2ZGCNey6eaNp6ypscrWCQogC++XAjq7yWvaB9v3GfpL0P8Dq+d29NetlvpLFZ1xnkbeuUg9R2m7FBZYkPFw==", "dependencies": { - "@asyncapi/specs": "^6.2.1", + "@asyncapi/specs": "^6.3.0", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -173,9 +173,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.2.1.tgz", - "integrity": "sha512-rfd0bzJrApEbxYD4U1SUG02GGG6lK6i6lup9LDWpVu1QwwuMNLAgf8+jsmsf3e7OinB/lauxRumGODXCxBu5Jw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.3.0.tgz", + "integrity": "sha512-Ui7Fekd/ruqd4hTSb5ogsTG8eylHEyKR5qKOtg+HwOYWlUEtObOD2UlhbuASiB4YnG5SSfkEKR5YsUJmf/ESYQ==", "dependencies": { "@types/json-schema": "^7.0.11" } diff --git a/library/package.json b/library/package.json index 03f4354..0f6efe8 100644 --- a/library/package.json +++ b/library/package.json @@ -49,7 +49,7 @@ "get:version": "echo $npm_package_version" }, "dependencies": { - "@asyncapi/parser": "^3.0.3", + "@asyncapi/parser": "^3.0.4", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", From f8588ec6f95ca2d961ae78fd5bdefbfb4b9dc9d4 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 11 Mar 2024 22:28:06 +0100 Subject: [PATCH 03/19] ci: update of files from global .github repo (#57) --- .github/workflows/bump.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index e5f8351..dff50cf 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -26,9 +26,9 @@ jobs: run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT - if: steps.packagejson.outputs.exists == 'true' name: Bumping latest version of this package in other repositories - uses: derberg/npm-dependency-manager-for-your-github-org@26a4f13d740254719971325046822a169aaa7441 # using v5.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v5.0.0 + uses: derberg/npm-dependency-manager-for-your-github-org@3df56be95bcaa5c76a9c9a4af863ab151545b649 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 with: github_token: ${{ secrets.GH_TOKEN }} committer_username: asyncapi-bot committer_email: info@asyncapi.io - repos_to_ignore: spec,bindings + repos_to_ignore: spec,bindings,saunter From 9b33485772fbcd7804b199a8ca06c7167010c0b0 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 14 Mar 2024 08:28:13 +0100 Subject: [PATCH 04/19] fix: update @asyncapi/parser to 3.0.8 version (#58) --- library/package-lock.json | 16 ++++++++-------- library/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index 2a2f8d0..e695c7c 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/parser": "^3.0.4", + "@asyncapi/parser": "^3.0.8", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", @@ -65,11 +65,11 @@ } }, "node_modules/@asyncapi/parser": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.4.tgz", - "integrity": "sha512-xop2ZGCNey6eaNp6ypscrWCQogC++XAjq7yWvaB9v3GfpL0P8Dq+d29NetlvpLFZ1xnkbeuUg9R2m7FBZYkPFw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.8.tgz", + "integrity": "sha512-BdH+Or1MjZdoBotz1DkwY6aW3CPWA5fcFMAngmBkviIHhmZqZBn7hA55WQ5YeYbRytct/o2ATtVI/pHbU/wPGg==", "dependencies": { - "@asyncapi/specs": "^6.3.0", + "@asyncapi/specs": "^6.5.1", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -173,9 +173,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.3.0.tgz", - "integrity": "sha512-Ui7Fekd/ruqd4hTSb5ogsTG8eylHEyKR5qKOtg+HwOYWlUEtObOD2UlhbuASiB4YnG5SSfkEKR5YsUJmf/ESYQ==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.1.tgz", + "integrity": "sha512-T7pOyVt7jo3VV3dPVvWwGYde/09WyFa0Qpq8Yjj06UNWJoXACftsdRF/pK0qLtjC0NAB8YV0AlDvxASYiwXq3g==", "dependencies": { "@types/json-schema": "^7.0.11" } diff --git a/library/package.json b/library/package.json index 0f6efe8..d6b6e3b 100644 --- a/library/package.json +++ b/library/package.json @@ -49,7 +49,7 @@ "get:version": "echo $npm_package_version" }, "dependencies": { - "@asyncapi/parser": "^3.0.4", + "@asyncapi/parser": "^3.0.8", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", From e166ee8e98c32cf4ca53ae70fcda3eaf739049a7 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 14 Mar 2024 11:56:43 +0100 Subject: [PATCH 05/19] fix: update @asyncapi/parser to 3.0.9 version (#59) --- library/package-lock.json | 16 ++++++++-------- library/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index e695c7c..1150d87 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/parser": "^3.0.8", + "@asyncapi/parser": "^3.0.9", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", @@ -65,11 +65,11 @@ } }, "node_modules/@asyncapi/parser": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.8.tgz", - "integrity": "sha512-BdH+Or1MjZdoBotz1DkwY6aW3CPWA5fcFMAngmBkviIHhmZqZBn7hA55WQ5YeYbRytct/o2ATtVI/pHbU/wPGg==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.9.tgz", + "integrity": "sha512-xsuW8UHWwQD8zbGCYirA6gjRkVUL9+RxboQY1Fm+AFlRo9cL9kMQr7OvfduJErI0PEsp/KdkuP56s7izlt5/+A==", "dependencies": { - "@asyncapi/specs": "^6.5.1", + "@asyncapi/specs": "^6.5.2", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -173,9 +173,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.1.tgz", - "integrity": "sha512-T7pOyVt7jo3VV3dPVvWwGYde/09WyFa0Qpq8Yjj06UNWJoXACftsdRF/pK0qLtjC0NAB8YV0AlDvxASYiwXq3g==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.3.tgz", + "integrity": "sha512-mZROlCOLkZEWy5tN4pPop3JEJflSKmLLMGO1TebF5wjnroqZ3yp/GuGUxVIl3jVNxFk1i5nZ2AtWzAD/HaUj3Q==", "dependencies": { "@types/json-schema": "^7.0.11" } diff --git a/library/package.json b/library/package.json index d6b6e3b..8eb6c91 100644 --- a/library/package.json +++ b/library/package.json @@ -49,7 +49,7 @@ "get:version": "echo $npm_package_version" }, "dependencies": { - "@asyncapi/parser": "^3.0.8", + "@asyncapi/parser": "^3.0.9", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", From 1341bed47247d4a8d67fd561d299e1e300329263 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 14 Mar 2024 13:47:55 +0100 Subject: [PATCH 06/19] fix: update @asyncapi/parser to 3.0.10 version (#60) --- library/package-lock.json | 10 +++++----- library/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index 1150d87..6b71332 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/parser": "^3.0.9", + "@asyncapi/parser": "^3.0.10", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", @@ -65,11 +65,11 @@ } }, "node_modules/@asyncapi/parser": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.9.tgz", - "integrity": "sha512-xsuW8UHWwQD8zbGCYirA6gjRkVUL9+RxboQY1Fm+AFlRo9cL9kMQr7OvfduJErI0PEsp/KdkuP56s7izlt5/+A==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.10.tgz", + "integrity": "sha512-x9qo7SHGzPWbC1XCRyilcI+Z6UZsWZ9uRl05h9j4G/v+3IjNG3krwngiAbt59nbLlYZD/nBS7Hc03GayoocnQw==", "dependencies": { - "@asyncapi/specs": "^6.5.2", + "@asyncapi/specs": "^6.5.3", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", diff --git a/library/package.json b/library/package.json index 8eb6c91..3e3f12c 100644 --- a/library/package.json +++ b/library/package.json @@ -49,7 +49,7 @@ "get:version": "echo $npm_package_version" }, "dependencies": { - "@asyncapi/parser": "^3.0.9", + "@asyncapi/parser": "^3.0.10", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", From decec155192cfb649b0ab79b1eff9f51f4ab4293 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 18 Mar 2024 09:44:38 +0100 Subject: [PATCH 07/19] ci: update of files from global .github repo (#61) --- .github/workflows/bounty-program-commands.yml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/bounty-program-commands.yml diff --git a/.github/workflows/bounty-program-commands.yml b/.github/workflows/bounty-program-commands.yml new file mode 100644 index 0000000..433f7d9 --- /dev/null +++ b/.github/workflows/bounty-program-commands.yml @@ -0,0 +1,90 @@ +# This workflow is centrally managed at https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repository, as they will be overwritten with +# changes made to the same file in the abovementioned repository. + +# The purpose of this workflow is to allow Bounty Team members +# (https://github.com/orgs/asyncapi/teams/bounty_team) to issue commands to the +# organization's global AsyncAPI bot related to the Bounty Program, while at the +# same time preventing unauthorized users from misusing them. + +name: Bounty Program commands + +on: + issue_comment: + types: + - created + +jobs: + guard-against-unauthorized-use: + if: > + github.actor != ('aeworxet' || 'thulieblack') && + ( + contains(github.event.comment.body, '/bounty' ) + ) + + runs-on: ubuntu-latest + + steps: + - name: ❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command + uses: actions/github-script@v6 + + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const commentText = `❌ @${{github.actor}} is not authorized to use the Bounty Program's commands. + These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`; + + console.log(`❌ @${{github.actor}} made an unauthorized attempt to use a Bounty Program's command.`); + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: commentText + }) + + add-label-bounty: + if: > + github.actor == ('aeworxet' || 'thulieblack') && + ( + contains(github.event.comment.body, '/bounty' ) + ) + + runs-on: ubuntu-latest + env: + BOUNTY_PROGRAM_LABELS_JSON: | + [ + {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} + ] + + steps: + - name: Add label `bounty` + uses: actions/github-script@v6 + + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); + let LIST_OF_LABELS_FOR_REPO = await github.rest.issues.listLabelsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + + LIST_OF_LABELS_FOR_REPO = LIST_OF_LABELS_FOR_REPO.data.map(key => key.name); + + if (!LIST_OF_LABELS_FOR_REPO.includes(BOUNTY_PROGRAM_LABELS[0].name)) { + await github.rest.issues.createLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: BOUNTY_PROGRAM_LABELS[0].name, + color: BOUNTY_PROGRAM_LABELS[0].color, + description: BOUNTY_PROGRAM_LABELS[0].description + }); + } + + console.log('Adding label `bounty`...'); + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [BOUNTY_PROGRAM_LABELS[0].name] + }) From 7af09a5ce9f492cf4e67cb8b90ede01bc8e8f52e Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Sun, 31 Mar 2024 19:15:38 +0200 Subject: [PATCH 08/19] fix: update @asyncapi/parser to 3.0.11 version (#62) --- library/package-lock.json | 16 ++++++++-------- library/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index 6b71332..b924391 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/parser": "^3.0.10", + "@asyncapi/parser": "^3.0.11", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", @@ -65,11 +65,11 @@ } }, "node_modules/@asyncapi/parser": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.10.tgz", - "integrity": "sha512-x9qo7SHGzPWbC1XCRyilcI+Z6UZsWZ9uRl05h9j4G/v+3IjNG3krwngiAbt59nbLlYZD/nBS7Hc03GayoocnQw==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.11.tgz", + "integrity": "sha512-YrmPY6Me7Eh6yH7xISKrDuiybaNVDUxVjbChUAoJZ4dnVGAmMVTxQTlwoqEwQ9bfTHzAb3RixdJ3TC6I4RoHNw==", "dependencies": { - "@asyncapi/specs": "^6.5.3", + "@asyncapi/specs": "^6.5.4", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -173,9 +173,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.3.tgz", - "integrity": "sha512-mZROlCOLkZEWy5tN4pPop3JEJflSKmLLMGO1TebF5wjnroqZ3yp/GuGUxVIl3jVNxFk1i5nZ2AtWzAD/HaUj3Q==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.4.tgz", + "integrity": "sha512-olC+iuboGIGjFRKuqfwaXxm5I6Wae3JohmySwMfExl21nYUd88IbfwywunOPLWyLV05aXeoTJ5tDXiM9e4gWcQ==", "dependencies": { "@types/json-schema": "^7.0.11" } diff --git a/library/package.json b/library/package.json index 3e3f12c..79fa0d1 100644 --- a/library/package.json +++ b/library/package.json @@ -49,7 +49,7 @@ "get:version": "echo $npm_package_version" }, "dependencies": { - "@asyncapi/parser": "^3.0.10", + "@asyncapi/parser": "^3.0.11", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", From 33236c2f9f431ff9dacf556d35808c18c01f3175 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 2 Apr 2024 20:52:59 +0200 Subject: [PATCH 09/19] ci: update of files from global .github repo (#63) --- .github/workflows/if-nodejs-pr-testing.yml | 5 +++-- .github/workflows/if-nodejs-release.yml | 10 +++++++++- .github/workflows/if-nodejs-version-bump.yml | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 9ce9f9a..75eaaac 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -33,6 +33,7 @@ jobs: id: should_run name: Should Run run: echo "shouldrun=true" >> $GITHUB_OUTPUT + shell: bash - if: steps.should_run.outputs.shouldrun == 'true' name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows run: | @@ -60,13 +61,13 @@ jobs: - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies id: first-installation - run: npm install --loglevel verbose + run: npm ci continue-on-error: true - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' name: Clear NPM cache and install deps again run: | npm cache clean --force - npm install --loglevel verbose + npm ci - if: steps.packagejson.outputs.exists == 'true' name: Test run: npm test --if-present diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index 4938a37..fbad21d 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -85,6 +85,7 @@ jobs: - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT + shell: bash - if: steps.packagejson.outputs.exists == 'true' name: Check package-lock version uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master @@ -98,7 +99,14 @@ jobs: cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - run: npm install + id: first-installation + run: npm ci + continue-on-error: true + - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' + name: Clear NPM cache and install deps again + run: | + npm cache clean --force + npm ci - if: steps.packagejson.outputs.exists == 'true' name: Add plugin for conventional commits for semantic-release run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0 diff --git a/.github/workflows/if-nodejs-version-bump.yml b/.github/workflows/if-nodejs-version-bump.yml index 7e27f90..36847d8 100644 --- a/.github/workflows/if-nodejs-version-bump.yml +++ b/.github/workflows/if-nodejs-version-bump.yml @@ -37,7 +37,7 @@ jobs: cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - run: npm install + run: npm ci - if: steps.packagejson.outputs.exists == 'true' name: Assets generation run: npm run generate:assets --if-present From ca9d6bb04eba8c9bc7d2265ffbe272b4b741b110 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 2 Apr 2024 21:52:35 +0200 Subject: [PATCH 10/19] ci: update of files from global .github repo (#64) --- .github/workflows/help-command.yml | 1 + .../workflows/please-take-a-look-command.yml | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/please-take-a-look-command.yml diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index d4ba4a4..ada8168 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -31,6 +31,7 @@ jobs: At the moment the following comments are supported in pull requests: + - \`/please-take-a-look` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. - \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.` diff --git a/.github/workflows/please-take-a-look-command.yml b/.github/workflows/please-take-a-look-command.yml new file mode 100644 index 0000000..216055c --- /dev/null +++ b/.github/workflows/please-take-a-look-command.yml @@ -0,0 +1,54 @@ +# This action is centrally managed in https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo + +# It uses Github actions to listen for comments on issues and pull requests and +# if the comment contains /ping-for-attention or /pfa it will add a comment pinging +# the code-owners who have not yet reviewed the pull request + +name: Please take a Look + +on: + issue_comment: + types: [created] + +jobs: + ping-for-attention: + if: > + github.event.issue.pull_request && + github.event.issue.state != 'closed' && + github.actor != 'asyncapi-bot' && + ( + contains(github.event.comment.body, '/please-take-a-look') || + contains(github.event.comment.body, '/ptal') || + contains(github.event.comment.body, '/PTAL') + ) + runs-on: ubuntu-latest + steps: + - name: Check for Please Take a Look Command + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const prDetailsUrl = context.payload.issue.pull_request.url; + const { data: pull } = await github.request(prDetailsUrl); + const reviewers = pull.requested_reviewers.map(reviewer => reviewer.login); + + const { data: reviews } = await github.rest.pulls.listReviews({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }); + + const reviewersWhoHaveReviewed = reviews.map(review => review.user.login); + + const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); + + if (reviewersWhoHaveNotReviewed.length > 0) { + const comment = reviewersWhoHaveNotReviewed.map(reviewer => `@${reviewer}`).join(' '); + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `${comment} Please take a look at this PR. Thanks! :wave:` + }); + } From b55954493df224471f070d0a3b10bcddf09ca270 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 3 Apr 2024 16:58:28 +0200 Subject: [PATCH 11/19] fix: update @asyncapi/parser to 3.0.12 version (#65) --- library/package-lock.json | 16 ++++++++-------- library/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index b924391..6656205 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -9,7 +9,7 @@ "version": "1.2.0", "license": "Apache-2.0", "dependencies": { - "@asyncapi/parser": "^3.0.11", + "@asyncapi/parser": "^3.0.12", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", @@ -65,11 +65,11 @@ } }, "node_modules/@asyncapi/parser": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.11.tgz", - "integrity": "sha512-YrmPY6Me7Eh6yH7xISKrDuiybaNVDUxVjbChUAoJZ4dnVGAmMVTxQTlwoqEwQ9bfTHzAb3RixdJ3TC6I4RoHNw==", + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.12.tgz", + "integrity": "sha512-F46FSg6XZDy8LSE0U8MnK0JsvRdDXN2XwE/prewr6d+JE1DNR7fwYAFty7SNh2Ym04D5G+YHZEm2QbbzOsrbsQ==", "dependencies": { - "@asyncapi/specs": "^6.5.4", + "@asyncapi/specs": "^6.5.5", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -173,9 +173,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.4.tgz", - "integrity": "sha512-olC+iuboGIGjFRKuqfwaXxm5I6Wae3JohmySwMfExl21nYUd88IbfwywunOPLWyLV05aXeoTJ5tDXiM9e4gWcQ==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.5.tgz", + "integrity": "sha512-5uPO22ZsLjh6ZdSHF/wROogOaA3BlYUOQqBf5+hdBbXXj/jIHJWHTYSLWCvws7DQM0++tHslFZ+xWbURTc927w==", "dependencies": { "@types/json-schema": "^7.0.11" } diff --git a/library/package.json b/library/package.json index 79fa0d1..9780aeb 100644 --- a/library/package.json +++ b/library/package.json @@ -49,7 +49,7 @@ "get:version": "echo $npm_package_version" }, "dependencies": { - "@asyncapi/parser": "^3.0.11", + "@asyncapi/parser": "^3.0.12", "canvas": "^2.9.1", "dompurify": "^2.3.8", "highlight.js": "^11.5.1", From 2670a4e66846fdb08b680a4c3e92baf439961f07 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 3 Apr 2024 20:22:13 +0200 Subject: [PATCH 12/19] ci: update of files from global .github repo (#66) --- .github/workflows/if-nodejs-pr-testing.yml | 2 +- .github/workflows/if-nodejs-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 75eaaac..73a2af5 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -63,7 +63,7 @@ jobs: id: first-installation run: npm ci continue-on-error: true - - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' + - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' name: Clear NPM cache and install deps again run: | npm cache clean --force diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index fbad21d..f407e59 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -102,7 +102,7 @@ jobs: id: first-installation run: npm ci continue-on-error: true - - if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true' + - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' name: Clear NPM cache and install deps again run: | npm cache clean --force From 8160ac3012e5a3fb5c4be22ad87377b8e33005bc Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 4 Apr 2024 16:38:42 +0200 Subject: [PATCH 13/19] ci: update of files from global .github repo (#67) --- .github/workflows/please-take-a-look-command.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/please-take-a-look-command.yml b/.github/workflows/please-take-a-look-command.yml index 216055c..b26cbc4 100644 --- a/.github/workflows/please-take-a-look-command.yml +++ b/.github/workflows/please-take-a-look-command.yml @@ -2,8 +2,8 @@ # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo # It uses Github actions to listen for comments on issues and pull requests and -# if the comment contains /ping-for-attention or /pfa it will add a comment pinging -# the code-owners who have not yet reviewed the pull request +# if the comment contains /please-take-a-look or /ptal it will add a comment pinging +# the code-owners who are reviewers for PR name: Please take a Look @@ -44,7 +44,7 @@ jobs: const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); if (reviewersWhoHaveNotReviewed.length > 0) { - const comment = reviewersWhoHaveNotReviewed.map(reviewer => `@${reviewer}`).join(' '); + const comment = reviewersWhoHaveNotReviewed.filter(reviewer => reviewer !== 'asyncapi-bot-eve' ).map(reviewer => `@${reviewer}`).join(' '); await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, From 3397607434b0cc43df0fe790c6054ff3c1cf0dff Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 8 Apr 2024 14:41:49 +0200 Subject: [PATCH 14/19] ci: update of files from global .github repo (#68) --- .github/workflows/help-command.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index ada8168..55353bb 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -31,7 +31,7 @@ jobs: At the moment the following comments are supported in pull requests: - - \`/please-take-a-look` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. + - \`/please-take-a-look\` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. - \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.` From f3d9bbabad0216ec1133702474aca6be304d07f1 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 9 Apr 2024 18:28:11 +0200 Subject: [PATCH 15/19] ci: update of files from global .github repo (#69) --- .github/workflows/if-nodejs-pr-testing.yml | 24 ++++++++--------- .github/workflows/if-nodejs-release.yml | 31 ++++++++++------------ 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 73a2af5..66ea655 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -39,9 +39,10 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + shell: bash - if: steps.should_run.outputs.shouldrun == 'true' name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - if: steps.should_run.outputs.shouldrun == 'true' name: Check if Node.js project and has package.json id: packagejson @@ -53,27 +54,26 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + #npm cli 10 is buggy because of some cache issue + name: Install npm cli 8 + shell: bash + run: npm install -g npm@8.19.4 - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - id: first-installation + shell: bash run: npm ci - continue-on-error: true - - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm ci - if: steps.packagejson.outputs.exists == 'true' name: Test run: npm test --if-present - - if: steps.packagejson.outputs.exists == 'true' + - if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' + #linting should run just one and not on all possible operating systems name: Run linter run: npm run lint --if-present - if: steps.packagejson.outputs.exists == 'true' name: Run release assets generation to make sure PR does not break it + shell: bash run: npm run generate:assets --if-present diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index f407e59..234c5a9 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -38,8 +38,9 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + shell: bash - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT @@ -50,14 +51,18 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + name: Install npm cli 8 + shell: bash + #npm cli 10 is buggy because of some cache issues + run: npm install -g npm@8.19.4 - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - run: npm install + shell: bash + run: npm ci - if: steps.packagejson.outputs.exists == 'true' name: Run test run: npm test --if-present @@ -81,7 +86,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT @@ -92,21 +97,13 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - id: first-installation + shell: bash run: npm ci - continue-on-error: true - - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm ci - if: steps.packagejson.outputs.exists == 'true' name: Add plugin for conventional commits for semantic-release run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0 @@ -131,4 +128,4 @@ jobs: fields: repo,action,workflow text: 'Release workflow failed in release job' env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} \ No newline at end of file From d9d986941738d6aa77eaaa4672afe5bf07dfe887 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 9 Apr 2024 18:37:00 +0200 Subject: [PATCH 16/19] ci: update of files from global .github repo (#70) --- .github/workflows/bump.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index dff50cf..1e17ccf 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -26,9 +26,10 @@ jobs: run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT - if: steps.packagejson.outputs.exists == 'true' name: Bumping latest version of this package in other repositories - uses: derberg/npm-dependency-manager-for-your-github-org@3df56be95bcaa5c76a9c9a4af863ab151545b649 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 + uses: derberg/npm-dependency-manager-for-your-github-org@1eafd3bf3974f21d395c1abac855cb04b295d570 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 with: github_token: ${{ secrets.GH_TOKEN }} committer_username: asyncapi-bot committer_email: info@asyncapi.io repos_to_ignore: spec,bindings,saunter + custom_id: "dependency update from asyncapi bot" From de8b0d7d9ad9d3d7704730624375ad5abb8a2978 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 18 Apr 2024 13:23:25 +0200 Subject: [PATCH 17/19] ci: update of files from global .github repo (#72) --- ...d-ready-to-merge-or-do-not-merge-label.yml | 4 +- .github/workflows/bump.yml | 2 +- .github/workflows/help-command.yml | 3 +- .github/workflows/update-pr.yml | 102 ++++++++++++++++++ 4 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/update-pr.yml diff --git a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml index 66606fc..02d71a7 100644 --- a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +++ b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml @@ -59,7 +59,9 @@ jobs: body: `Hello, @${{ github.actor }}! 👋🏼 This PR is not up to date with the base branch and can't be merged. Please update your branch manually with the latest version of the base branch. - PRO-TIP: Add a comment to your PR with the text: \`/au\` or \`/autoupdate\` and our bot will take care of updating the branch in the future. The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. + PRO-TIP: To request an update from the upstream branch, simply comment \`/u\` or \`/update\` and our bot will handle the update operation promptly. + + The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. Also the update will not work if your fork is located in an organization, not under your personal profile. Thanks 😄` }) } diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index 1e17ccf..43ba75f 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -31,5 +31,5 @@ jobs: github_token: ${{ secrets.GH_TOKEN }} committer_username: asyncapi-bot committer_email: info@asyncapi.io - repos_to_ignore: spec,bindings,saunter + repos_to_ignore: spec,bindings,saunter,server-api custom_id: "dependency update from asyncapi bot" diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 55353bb..3f4dcbc 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -34,7 +34,8 @@ jobs: - \`/please-take-a-look\` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. - \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.` + - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. (Currently only works for upstream branches.) + - \`/update\` or \`/u\` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.` }) create_help_comment_issue: diff --git a/.github/workflows/update-pr.yml b/.github/workflows/update-pr.yml new file mode 100644 index 0000000..2fa19b0 --- /dev/null +++ b/.github/workflows/update-pr.yml @@ -0,0 +1,102 @@ +# This workflow is centrally managed in https://github.com/asyncapi/.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo + +# This workflow will run on every comment with /update or /u. And will create merge-commits for the PR. +# This also works with forks, not only with branches in the same repository/organization. +# Currently, does not work with forks in different organizations. + +# This workflow will be distributed to all repositories in the AsyncAPI organization + +name: Update PR branches from fork + +on: + issue_comment: + types: [created] + +jobs: + update-pr: + if: > + startsWith(github.repository, 'asyncapi/') && + github.event.issue.pull_request && + github.event.issue.state != 'closed' && ( + contains(github.event.comment.body, '/update') || + contains(github.event.comment.body, '/u') + ) + runs-on: ubuntu-latest + steps: + - name: Get Pull Request Details + id: pr + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} + previews: 'merge-info-preview' # https://docs.github.com/en/graphql/overview/schema-previews#merge-info-preview-more-detailed-information-about-a-pull-requests-merge-state-preview + script: | + const prNumber = context.payload.issue.number; + core.debug(`PR Number: ${prNumber}`); + const { data: pr } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber + }); + + // If the PR has conflicts, we don't want to update it + const updateable = ['behind', 'blocked', 'unknown', 'draft', 'clean'].includes(pr.mergeable_state); + console.log(`PR #${prNumber} is ${pr.mergeable_state} and is ${updateable ? 'updateable' : 'not updateable'}`); + core.setOutput('updateable', updateable); + + core.debug(`Updating PR #${prNumber} with head ${pr.head.sha}`); + + return { + id: pr.node_id, + number: prNumber, + head: pr.head.sha, + } + - name: Update the Pull Request + if: steps.pr.outputs.updateable == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const mutation = `mutation update($input: UpdatePullRequestBranchInput!) { + updatePullRequestBranch(input: $input) { + pullRequest { + mergeable + } + } + }`; + + const pr_details = ${{ steps.pr.outputs.result }}; + + try { + const { data } = await github.graphql(mutation, { + input: { + pullRequestId: pr_details.id, + expectedHeadOid: pr_details.head, + } + }); + } catch (GraphQLError) { + core.debug(GraphQLError); + if ( + GraphQLError.name === 'GraphqlResponseError' && + GraphQLError.errors.some( + error => error.type === 'FORBIDDEN' || error.type === 'UNAUTHORIZED' + ) + ) { + // Add comment to PR if the bot doesn't have permissions to update the PR + const comment = `Hi @${context.actor}. Update of PR has failed. It can be due to one of the following reasons: + - I don't have permissions to update this PR. To update your fork with upstream using bot you need to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in the PR. + - The fork is located in an organization, not under your personal profile. No solution for that. You are on your own with manual update. + - There may be a conflict in the PR. Please resolve the conflict and try again.`; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + + core.setFailed('Bot does not have permissions to update the PR'); + } else { + core.setFailed(GraphQLError.message); + } + } From 71d97ec102ae33b7d63c93c52a369987b78bc9d5 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 30 Apr 2024 11:14:47 +0200 Subject: [PATCH 18/19] ci: update of files from global .github repo (#73) --- .github/workflows/if-nodejs-release.yml | 3 ++- .releaserc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index 234c5a9..e578d90 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -15,6 +15,7 @@ on: - next-major-spec - beta - alpha + - next jobs: @@ -128,4 +129,4 @@ jobs: fields: repo,action,workflow text: 'Release workflow failed in release job' env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} diff --git a/.releaserc b/.releaserc index bc27e35..1ac05cb 100644 --- a/.releaserc +++ b/.releaserc @@ -13,6 +13,8 @@ branches: prerelease: true - name: alpha prerelease: true +- name: next + prerelease: true plugins: - - "@semantic-release/commit-analyzer" - preset: conventionalcommits From 9d9a97dd0c63ce3a5a58bbfd3da2d03ff71e6cf3 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 6 May 2024 09:01:59 +0200 Subject: [PATCH 19/19] ci: update of files from global .github repo (#74) --- .github/workflows/bounty-program-commands.yml | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bounty-program-commands.yml b/.github/workflows/bounty-program-commands.yml index 433f7d9..645e0c9 100644 --- a/.github/workflows/bounty-program-commands.yml +++ b/.github/workflows/bounty-program-commands.yml @@ -14,12 +14,18 @@ on: types: - created +env: + BOUNTY_PROGRAM_LABELS_JSON: | + [ + {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} + ] + jobs: guard-against-unauthorized-use: if: > github.actor != ('aeworxet' || 'thulieblack') && ( - contains(github.event.comment.body, '/bounty' ) + startsWith(github.event.comment.body, '/bounty' ) ) runs-on: ubuntu-latest @@ -46,15 +52,10 @@ jobs: if: > github.actor == ('aeworxet' || 'thulieblack') && ( - contains(github.event.comment.body, '/bounty' ) + startsWith(github.event.comment.body, '/bounty' ) ) runs-on: ubuntu-latest - env: - BOUNTY_PROGRAM_LABELS_JSON: | - [ - {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} - ] steps: - name: Add label `bounty` @@ -88,3 +89,38 @@ jobs: repo: context.repo.repo, labels: [BOUNTY_PROGRAM_LABELS[0].name] }) + + remove-label-bounty: + if: > + github.actor == ('aeworxet' || 'thulieblack') && + ( + startsWith(github.event.comment.body, '/unbounty' ) + ) + + runs-on: ubuntu-latest + + steps: + - name: Remove label `bounty` + uses: actions/github-script@v6 + + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); + let LIST_OF_LABELS_FOR_ISSUE = await github.rest.issues.listLabelsOnIssue({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + + LIST_OF_LABELS_FOR_ISSUE = LIST_OF_LABELS_FOR_ISSUE.data.map(key => key.name); + + if (LIST_OF_LABELS_FOR_ISSUE.includes(BOUNTY_PROGRAM_LABELS[0].name)) { + console.log('Removing label `bounty`...'); + github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: [BOUNTY_PROGRAM_LABELS[0].name] + }) + }