Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update global workflows #512

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,28 @@ jobs:
await github.rest.repos.compareCommitsWithBasehead({
owner: pull.head.repo.owner.login,
repo: pull.head.repo.name,
basehead: `${pull.head.label}...${pull.base.label}`,
basehead: `${pull.base.label}...${pull.head.label}`,
});
if (comparison.behind_by !== 0) isUpToDate = false;
if (comparison.behind_by !== 0) {
console.log(`This branch is behind the target by ${comparison.behind_by} commits`)
isUpToDate = false;
} else console.log(`This branch is up-to-date.`)
return { isDraft, isUpToDate };

- uses: actions-ecosystem/action-create-comment@v1
if: ${{ !steps.checkPR.outputs.result.isUpToDate }}
if: ${{ !fromJson(steps.checkPR.outputs.result).isUpToDate }}
with:
github_token: ${{ secrets.GH_TOKEN }}
body: |
Hello, @${{ github.actor }}! 👋🏼
This PR is not up to date with the base branch and can't be merged.
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.
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.
Thanks 😄

- name: Add ready-to-merge label
if: ${{ !steps.checkPR.outputs.result.isDraft }}
if: ${{ !fromJson(steps.checkPR.outputs.result).isDraft }}
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ on:
- 'dependabot/**'
- 'bot/**'
- 'all-contributors/**'
pull_request:
types:
- labeled

jobs:
autoupdate-for-bot:
if: ${{ !github.event.issue.pull_request || contains(github.event.pull_request.labels.*.name, 'autoupdate') }}
name: Autoupdate autoapproved PR created in the upstream
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/help-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- `/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. Unless there is a merge conflict.
- `/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.
create_help_comment_issue:
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }}
runs-on: ubuntu-latest
Expand Down