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

chore: fix: event trigger label conflict #7936

Merged
merged 7 commits into from
Sep 15, 2023
Merged
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
32 changes: 14 additions & 18 deletions .github/workflows/label-conflict.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
name: Auto Label Conflicts
name: Auto Comment Conflicts
on:
pull_request:
branches:
- 'develop'
- '4.*'
types:
- labeled
Comment on lines 2 to +8
Copy link
Member

Choose a reason for hiding this comment

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

Should be?

on:
  pull_request:
    types:
      - labeled


concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read
issues: write
pull-requests: write

jobs:
auto-label:
auto-comment-conflict:
permissions:
contents: read
pull-requests: write
if: github.event.label.name == 'stale'
runs-on: ubuntu-latest
steps:
- uses: prince-chrismc/label-merge-conflicts-action@v3
- name: Add comment for PR with conflict
uses: peter-evans/create-or-update-comment@v3
with:
conflict_label_name: 'stale'
github_token: ${{ github.token }}

# --- Optional Inputs ---
# To make sure the merge commit exactly matches the branch
detect_merge_changes: true # or true to handle as conflicts
# By default a comment will be left, adding `conflict_comment: ''` will disable comments
# The optional `${author}` will be replaced with the username of the pull request
conflict_comment: |
:wave: Hi, @${author},
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
:wave: Hi, @${{ github.event.pull_request.user.login }}!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!
Expand Down