Skip to content

Commit a99c4b3

Browse files
asyncapi-botWaleedAshraf
authored andcommitted
ci: update global workflows (asyncapi#512)
1 parent e8d9260 commit a99c4b3

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,28 @@ jobs:
4242
await github.rest.repos.compareCommitsWithBasehead({
4343
owner: pull.head.repo.owner.login,
4444
repo: pull.head.repo.name,
45-
basehead: `${pull.head.label}...${pull.base.label}`,
45+
basehead: `${pull.base.label}...${pull.head.label}`,
4646
});
47-
if (comparison.behind_by !== 0) isUpToDate = false;
47+
if (comparison.behind_by !== 0) {
48+
console.log(`This branch is behind the target by ${comparison.behind_by} commits`)
49+
isUpToDate = false;
50+
} else console.log(`This branch is up-to-date.`)
4851
return { isDraft, isUpToDate };
4952
5053
- uses: actions-ecosystem/action-create-comment@v1
51-
if: ${{ !steps.checkPR.outputs.result.isUpToDate }}
54+
if: ${{ !fromJson(steps.checkPR.outputs.result).isUpToDate }}
5255
with:
5356
github_token: ${{ secrets.GH_TOKEN }}
5457
body: |
5558
Hello, @${{ github.actor }}! 👋🏼
5659
This PR is not up to date with the base branch and can't be merged.
57-
You can add comment to this PR with text: `/autoupdate` or `/au`. This way you ask our bot to perform regular updates for you. 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. Otherwise the only option that you have is to manually update your branch with latest version of the base branch.
60+
Please update your branch manually with the latest version of the base branch.
61+
62+
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.
5863
Thanks 😄
5964
6065
- name: Add ready-to-merge label
61-
if: ${{ !steps.checkPR.outputs.result.isDraft }}
66+
if: ${{ !fromJson(steps.checkPR.outputs.result).isDraft }}
6267
uses: actions/github-script@v5
6368
with:
6469
github-token: ${{ secrets.GH_TOKEN }}

.github/workflows/autoupdate.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ on:
1717
- 'dependabot/**'
1818
- 'bot/**'
1919
- 'all-contributors/**'
20-
pull_request:
21-
types:
22-
- labeled
2320

2421
jobs:
2522
autoupdate-for-bot:
26-
if: ${{ !github.event.issue.pull_request || contains(github.event.pull_request.labels.*.name, 'autoupdate') }}
2723
name: Autoupdate autoapproved PR created in the upstream
2824
runs-on: ubuntu-latest
2925
steps:

.github/workflows/help-command.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
2626
- `/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
2727
- `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
28-
- `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch. Unless there is a merge conflict.
28+
- `/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.
2929
create_help_comment_issue:
3030
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }}
3131
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)