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

feat: github action to check the merge conflict on push #218

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/merge_conflicts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Auto Comment Merge Conflicts

on: push
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on push to where? remember in AsyncAPI contributor make a push to the fork, will this action know that it runs in the scope of a fork but must place a comment in the upstream repository?


permissions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed? we never used it before

pull-requests: write

jobs:
auto-comment-merge-conflicts:
runs-on: ubuntu-latest
steps:
- uses: codytseng/auto-comment-merge-conflicts@v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: codytseng/auto-comment-merge-conflicts@v1
- uses: codytseng/auto-comment-merge-conflicts@d621e322650866ded2c0753ea565dd83a18e01ff #using 1.3 version https://github.com/CodyTseng/auto-comment-merge-conflicts/releases/tag/v1.3.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should always try to use commitId from actions that do not belong to GitHub itself, for security reason.

with:
token: ${{ secrets.GITHUB_TOKEN }}
comment-body: "Hey there 👋🏼, your current PR has some merge conflicts. KIndly try to resolve them in your local fork and push the new changes."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could give some hints? instructions? or maybe even action could figure that if conflict is with package-lock, what are the options to solve it?

wait-ms: 3000
max-retries: 5
ignore-authors: asyncapi-bot,dependabot[bot],dependabot-preview[bot],allcontributors