From 15787fdd8a3e90c92a7ae2c6ec58807fddf1936c Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:55:27 +0700 Subject: [PATCH 1/4] GH: auto label conflict PR --- .github/label-conflict.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/label-conflict.yml diff --git a/.github/label-conflict.yml b/.github/label-conflict.yml new file mode 100644 index 000000000000..fa9fe4a4408a --- /dev/null +++ b/.github/label-conflict.yml @@ -0,0 +1,38 @@ +name: Auto Label Conflicts +on: + push: + branches: + - 'develop' + - '4.*' + pull_request: + branches: + - 'develop' + - '4.*' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + auto-label: + runs-on: ubuntu-latest + steps: + - uses: prince-chrismc/label-merge-conflicts-action@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}, + We detected conflicts against the base branch :speak_no_evil: + You'll want to sync :arrows_counterclockwise: your branch with upstream! + + Ref: https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#pushing-your-branch From 4ac597b99e4576d70585ed5127ad0d7c9669d464 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:01:29 +0700 Subject: [PATCH 2/4] Update label-conflict.yml --- .github/label-conflict.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/label-conflict.yml b/.github/label-conflict.yml index fa9fe4a4408a..88292a261ec2 100644 --- a/.github/label-conflict.yml +++ b/.github/label-conflict.yml @@ -15,6 +15,8 @@ concurrency: permissions: contents: read + issues: write + pull-requests: write jobs: auto-label: From c3ccb20efea1105f0d3a1e65e93244be7b2c04e7 Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:28:56 +0700 Subject: [PATCH 3/4] remove uneeded trigger push --- .github/label-conflict.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/label-conflict.yml b/.github/label-conflict.yml index 88292a261ec2..3e4850ea250f 100644 --- a/.github/label-conflict.yml +++ b/.github/label-conflict.yml @@ -1,9 +1,5 @@ name: Auto Label Conflicts on: - push: - branches: - - 'develop' - - '4.*' pull_request: branches: - 'develop' From 664aceb94b5a03a0ffbd31bcf21b15d2209bfeed Mon Sep 17 00:00:00 2001 From: Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com> Date: Mon, 11 Sep 2023 15:49:02 +0700 Subject: [PATCH 4/4] fix: message issue comment --- .github/label-conflict.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/label-conflict.yml b/.github/label-conflict.yml index 3e4850ea250f..0030dd06bede 100644 --- a/.github/label-conflict.yml +++ b/.github/label-conflict.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: prince-chrismc/label-merge-conflicts-action@v3 with: - conflict_label_name: "stale" + conflict_label_name: 'stale' github_token: ${{ github.token }} # --- Optional Inputs --- @@ -30,7 +30,8 @@ jobs: # The optional `${author}` will be replaced with the username of the pull request conflict_comment: | :wave: Hi, @${author}, - We detected conflicts against the base branch :speak_no_evil: - You'll want to sync :arrows_counterclockwise: your branch with upstream! + + We detected conflicts in your PR against the base branch :speak_no_evil: + You may want to sync :arrows_counterclockwise: your branch with upstream! Ref: https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#pushing-your-branch