From 8eee39212596983bb37ba5103829f08ad3f5f723 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 8 Apr 2024 14:19:44 +0200 Subject: [PATCH 01/10] ci: update of files from global .github repo (#981) --- .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 ada81682e..55353bb89 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 75aa3f2275525bef3a0da4217c0aecad2f7801cd Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 9 Apr 2024 18:13:35 +0200 Subject: [PATCH 02/10] ci: update of files from global .github repo (#983) --- .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 73a2af5c2..66ea65528 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 f407e59ae..234c5a9c5 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 f7d79d98e396ff9c755a88b45e05b3ee068951a9 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 9 Apr 2024 18:34:22 +0200 Subject: [PATCH 03/10] ci: update of files from global .github repo (#984) --- .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 dff50cfaa..1e17ccf2d 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 029282022a6f31e540c968d44ffd22b06da0b7f4 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 15 Apr 2024 12:15:34 +0200 Subject: [PATCH 04/10] fix: update @asyncapi/specs to 6.5.6 version and others (#985) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 89d7f7106..56051c039 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "3.0.12", "license": "Apache-2.0", "dependencies": { - "@asyncapi/specs": "^6.5.5", + "@asyncapi/specs": "^6.5.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -120,9 +120,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.5.tgz", - "integrity": "sha512-5uPO22ZsLjh6ZdSHF/wROogOaA3BlYUOQqBf5+hdBbXXj/jIHJWHTYSLWCvws7DQM0++tHslFZ+xWbURTc927w==", + "version": "6.5.6", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.6.tgz", + "integrity": "sha512-TI3OIY0UFf7wPyjV9GjKqL6C4YJ0xOJ7wX33sxVqCf0XXIq4otGHa1XiBcCUAgdbMlO7b8jsFRxuUsVXCsYDVQ==", "dependencies": { "@types/json-schema": "^7.0.11" } @@ -11173,9 +11173,9 @@ } }, "@asyncapi/specs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.5.tgz", - "integrity": "sha512-5uPO22ZsLjh6ZdSHF/wROogOaA3BlYUOQqBf5+hdBbXXj/jIHJWHTYSLWCvws7DQM0++tHslFZ+xWbURTc927w==", + "version": "6.5.6", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.6.tgz", + "integrity": "sha512-TI3OIY0UFf7wPyjV9GjKqL6C4YJ0xOJ7wX33sxVqCf0XXIq4otGHa1XiBcCUAgdbMlO7b8jsFRxuUsVXCsYDVQ==", "requires": { "@types/json-schema": "^7.0.11" } diff --git a/package.json b/package.json index 25bba3cab..41187426b 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "prepublishOnly": "npm run generate:assets" }, "dependencies": { - "@asyncapi/specs": "^6.5.5", + "@asyncapi/specs": "^6.5.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", From 8f388b83f1d4cdc4fa7a10fd1dad1e6fd0388974 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 15 Apr 2024 12:25:14 +0200 Subject: [PATCH 05/10] chore(release): v3.0.13 (#986) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 56051c039..72af99d92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/parser", - "version": "3.0.12", + "version": "3.0.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@asyncapi/parser", - "version": "3.0.12", + "version": "3.0.13", "license": "Apache-2.0", "dependencies": { "@asyncapi/specs": "^6.5.6", diff --git a/package.json b/package.json index 41187426b..ec16c0453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/parser", - "version": "3.0.12", + "version": "3.0.13", "description": "JavaScript AsyncAPI parser.", "bugs": { "url": "https://github.com/asyncapi/parser-js/issues" From 092dcbaf530d3c95b76e99d0f8abae6300d014f8 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 18 Apr 2024 11:37:15 +0200 Subject: [PATCH 06/10] fix: update @asyncapi/specs to 6.6.0 version and others (#987) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 72af99d92..e3c24e4e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "3.0.13", "license": "Apache-2.0", "dependencies": { - "@asyncapi/specs": "^6.5.6", + "@asyncapi/specs": "^6.6.0", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -120,9 +120,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.5.6", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.6.tgz", - "integrity": "sha512-TI3OIY0UFf7wPyjV9GjKqL6C4YJ0xOJ7wX33sxVqCf0XXIq4otGHa1XiBcCUAgdbMlO7b8jsFRxuUsVXCsYDVQ==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.6.0.tgz", + "integrity": "sha512-pXJa0sCeBpif5al5CSa0f3HvwVBQXzd96/Xgq8Jsh6KM4CYxCe7p6paaC9fDjdBVXyWAioQmZiGRxEVUMINbUw==", "dependencies": { "@types/json-schema": "^7.0.11" } @@ -11173,9 +11173,9 @@ } }, "@asyncapi/specs": { - "version": "6.5.6", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.5.6.tgz", - "integrity": "sha512-TI3OIY0UFf7wPyjV9GjKqL6C4YJ0xOJ7wX33sxVqCf0XXIq4otGHa1XiBcCUAgdbMlO7b8jsFRxuUsVXCsYDVQ==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.6.0.tgz", + "integrity": "sha512-pXJa0sCeBpif5al5CSa0f3HvwVBQXzd96/Xgq8Jsh6KM4CYxCe7p6paaC9fDjdBVXyWAioQmZiGRxEVUMINbUw==", "requires": { "@types/json-schema": "^7.0.11" } diff --git a/package.json b/package.json index ec16c0453..e8d2f18ba 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "prepublishOnly": "npm run generate:assets" }, "dependencies": { - "@asyncapi/specs": "^6.5.6", + "@asyncapi/specs": "^6.6.0", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", From 2746a57e41563277655952db1ac63ba03f2ed6e1 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 18 Apr 2024 11:46:41 +0200 Subject: [PATCH 07/10] chore(release): v3.0.14 (#988) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e3c24e4e4..f7fa35196 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/parser", - "version": "3.0.13", + "version": "3.0.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@asyncapi/parser", - "version": "3.0.13", + "version": "3.0.14", "license": "Apache-2.0", "dependencies": { "@asyncapi/specs": "^6.6.0", diff --git a/package.json b/package.json index e8d2f18ba..099257390 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/parser", - "version": "3.0.13", + "version": "3.0.14", "description": "JavaScript AsyncAPI parser.", "bugs": { "url": "https://github.com/asyncapi/parser-js/issues" From 5abb4d70eb3d4165a311c82fab0d7bc813433435 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 18 Apr 2024 12:23:40 +0200 Subject: [PATCH 08/10] chore: update @asyncapi/avro-schema-parser to 3.0.22 version and others (#989) --- package-lock.json | 34 +++++++++++++++++----------------- package.json | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7fa35196..4be751121 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "node-fetch": "2.6.7" }, "devDependencies": { - "@asyncapi/avro-schema-parser": "^3.0.20", + "@asyncapi/avro-schema-parser": "^3.0.22", "@jest/types": "^29.0.2", "@swc/core": "^1.2.248", "@swc/jest": "^0.2.22", @@ -82,23 +82,23 @@ } }, "node_modules/@asyncapi/avro-schema-parser": { - "version": "3.0.20", - "resolved": "https://registry.npmjs.org/@asyncapi/avro-schema-parser/-/avro-schema-parser-3.0.20.tgz", - "integrity": "sha512-VwXpuK5hlwikBlqgbYAhabOvN/suSqPljZ5xqw6Tq+zcay0duyLK+nKdBEGuae4uLsFricHmbsfgedTczP3YqQ==", + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/@asyncapi/avro-schema-parser/-/avro-schema-parser-3.0.22.tgz", + "integrity": "sha512-nrrIIPehHoS1+Zc0eCO3+ijo7VJhWaFqVTupFYJVxxiwNrx7HpldLiTt1awIUDU6rJTm9czGLQq8MIgtXb/Dqg==", "dev": true, "dependencies": { - "@asyncapi/parser": "^3.0.12", + "@asyncapi/parser": "^3.0.14", "@types/json-schema": "^7.0.11", "avsc": "^5.7.6" } }, "node_modules/@asyncapi/parser": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.12.tgz", - "integrity": "sha512-F46FSg6XZDy8LSE0U8MnK0JsvRdDXN2XwE/prewr6d+JE1DNR7fwYAFty7SNh2Ym04D5G+YHZEm2QbbzOsrbsQ==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.14.tgz", + "integrity": "sha512-tC2gmKkw28PWWMcGUXHQjTfVftiZdr+FQtsfapaHh36spX9uwe13iYzkcTyCkwSJAHibtg7wvStuHsiufP8xng==", "dev": true, "dependencies": { - "@asyncapi/specs": "^6.5.5", + "@asyncapi/specs": "^6.6.0", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -11135,23 +11135,23 @@ } }, "@asyncapi/avro-schema-parser": { - "version": "3.0.20", - "resolved": "https://registry.npmjs.org/@asyncapi/avro-schema-parser/-/avro-schema-parser-3.0.20.tgz", - "integrity": "sha512-VwXpuK5hlwikBlqgbYAhabOvN/suSqPljZ5xqw6Tq+zcay0duyLK+nKdBEGuae4uLsFricHmbsfgedTczP3YqQ==", + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/@asyncapi/avro-schema-parser/-/avro-schema-parser-3.0.22.tgz", + "integrity": "sha512-nrrIIPehHoS1+Zc0eCO3+ijo7VJhWaFqVTupFYJVxxiwNrx7HpldLiTt1awIUDU6rJTm9czGLQq8MIgtXb/Dqg==", "dev": true, "requires": { - "@asyncapi/parser": "^3.0.12", + "@asyncapi/parser": "^3.0.14", "@types/json-schema": "^7.0.11", "avsc": "^5.7.6" } }, "@asyncapi/parser": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.12.tgz", - "integrity": "sha512-F46FSg6XZDy8LSE0U8MnK0JsvRdDXN2XwE/prewr6d+JE1DNR7fwYAFty7SNh2Ym04D5G+YHZEm2QbbzOsrbsQ==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.14.tgz", + "integrity": "sha512-tC2gmKkw28PWWMcGUXHQjTfVftiZdr+FQtsfapaHh36spX9uwe13iYzkcTyCkwSJAHibtg7wvStuHsiufP8xng==", "dev": true, "requires": { - "@asyncapi/specs": "^6.5.5", + "@asyncapi/specs": "^6.6.0", "@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/package.json b/package.json index 099257390..ad078d74e 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "node-fetch": "2.6.7" }, "devDependencies": { - "@asyncapi/avro-schema-parser": "^3.0.20", + "@asyncapi/avro-schema-parser": "^3.0.22", "@jest/types": "^29.0.2", "@swc/core": "^1.2.248", "@swc/jest": "^0.2.22", From a40889ddc21c81e77fa59891323018aa63b2aa3e Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 18 Apr 2024 12:54:21 +0200 Subject: [PATCH 09/10] ci: update of files from global .github repo (#990) --- ...d-ready-to-merge-or-do-not-merge-label.yml | 4 +- .github/workflows/autoupdate.yml | 68 ++++++------ .github/workflows/help-command.yml | 3 +- .github/workflows/update-pr.yml | 102 ++++++++++++++++++ 4 files changed, 141 insertions(+), 36 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 66606fc17..02d71a796 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/autoupdate.yml b/.github/workflows/autoupdate.yml index ad8e0198f..eeb77a47b 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -1,34 +1,34 @@ -# 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 - -# This workflow is designed to work with: -# - autoapprove and automerge workflows for dependabot and asyncapibot. -# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against - -# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. -# Autoupdating to latest destination branch works only in the context of upstream repo and not forks - -name: autoupdate - -on: - push: - branches-ignore: - - 'version-bump/**' - - 'dependabot/**' - - 'bot/**' - - 'all-contributors/**' - -jobs: - autoupdate-for-bot: - if: startsWith(github.repository, 'asyncapi/') - name: Autoupdate autoapproved PR created in the upstream - runs-on: ubuntu-latest - steps: - - name: Autoupdating - uses: docker://chinthakagodawita/autoupdate-action:v1 - env: - GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' - PR_FILTER: "labelled" - PR_LABELS: "autoupdate" - PR_READY_STATE: "ready_for_review" - MERGE_CONFLICT_ACTION: "ignore" +# 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 + +# This workflow is designed to work with: +# - autoapprove and automerge workflows for dependabot and asyncapibot. +# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against + +# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. +# Autoupdating to latest destination branch works only in the context of upstream repo and not forks + +name: autoupdate + +on: + push: + branches-ignore: + - 'version-bump/**' + - 'dependabot/**' + - 'bot/**' + - 'all-contributors/**' + +jobs: + autoupdate-for-bot: + if: startsWith(github.repository, 'asyncapi/') + name: Autoupdate autoapproved PR created in the upstream + runs-on: ubuntu-latest + steps: + - name: Autoupdating + uses: docker://chinthakagodawita/autoupdate-action:v1 + env: + GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' + PR_FILTER: "labelled" + PR_LABELS: "autoupdate" + PR_READY_STATE: "ready_for_review" + MERGE_CONFLICT_ACTION: "ignore" diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 55353bb89..3f4dcbc4c 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 000000000..2fa19b0ad --- /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 748306a23c51dcb8639632cabd478a60b7433d0a Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 18 Apr 2024 13:24:27 +0200 Subject: [PATCH 10/10] ci: update of files from global .github repo (#991) --- .github/workflows/bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index 1e17ccf2d..43ba75fd5 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"