From b72762bc86da3cb2f987d4cf119f6e5746888699 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 22 Mar 2023 10:55:37 -0400 Subject: [PATCH 1/5] Add merge conflict comment --- .github/workflows/automation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index e69d125c56..97cc382b47 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -17,4 +17,5 @@ jobs: - uses: eps1lon/actions-label-merge-conflict@fd1f295ee7443d13745804bc49fe158e240f6c6e # tag=v2.1.0 with: dirtyLabel: 'merge conflict' + commentOnDirty: 'This pull request has merge conflicts, please resolve the conflicts so the PR can be successfully reviewed and merged.' repoToken: ${{ secrets.JF_BOT_TOKEN }} From 67f3e8a119addf86eda1ed7b0fe29900d29dbef1 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 22 Mar 2023 11:05:36 -0400 Subject: [PATCH 2/5] Remove comma splice from new message --- .github/workflows/automation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automation.yml b/.github/workflows/automation.yml index 97cc382b47..5bf60036f6 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automation.yml @@ -17,5 +17,5 @@ jobs: - uses: eps1lon/actions-label-merge-conflict@fd1f295ee7443d13745804bc49fe158e240f6c6e # tag=v2.1.0 with: dirtyLabel: 'merge conflict' - commentOnDirty: 'This pull request has merge conflicts, please resolve the conflicts so the PR can be successfully reviewed and merged.' + commentOnDirty: 'This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.' repoToken: ${{ secrets.JF_BOT_TOKEN }} From c4bd939ea6ca2cb04c9209356a7f556ce6b3c95c Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 22 Mar 2023 12:12:51 -0400 Subject: [PATCH 3/5] Add action to close PRs with merge conflicts --- .github/workflows/repo-stale.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/repo-stale.yaml b/.github/workflows/repo-stale.yaml index 119c24f9cb..a0e05022b9 100644 --- a/.github/workflows/repo-stale.yaml +++ b/.github/workflows/repo-stale.yaml @@ -1,12 +1,17 @@ -name: Issue Stale Check +name: Stale Check on: schedule: - cron: '30 1 * * *' workflow_dispatch: +permissions: + issues: write + pull-requests: write + jobs: - stale: + issues: + name: Check issues runs-on: ubuntu-latest if: ${{ contains(github.repository, 'jellyfin/') }} steps: @@ -25,3 +30,18 @@ jobs: If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label. This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on [Matrix or Social Media](https://jellyfin.org/contact). + + prs-conflicts: + name: Check PRs with merge conflicts + runs-on: ubuntu-latest + if: ${{ contains(github.repository, 'jellyfin/') }} + steps: + - uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b # v7.0.0 + with: + repo-token: ${{ secrets.JF_BOT_TOKEN }} + days-before-stale: -1 + days-before-close: 90 + days-before-issue-close: -1 + stale-pr-label: merge conflict + close-pr-message: |- + This PR has been closed due to having unresolved merge conflicts. From 17e6b19210a09188c1d0d28743e8d057faad74e3 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 22 Mar 2023 12:37:56 -0400 Subject: [PATCH 4/5] Update stale action operations per run --- .github/workflows/repo-stale.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/repo-stale.yaml b/.github/workflows/repo-stale.yaml index a0e05022b9..2c9bcf6e81 100644 --- a/.github/workflows/repo-stale.yaml +++ b/.github/workflows/repo-stale.yaml @@ -18,6 +18,7 @@ jobs: - uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b # v7.0.0 with: repo-token: ${{ secrets.JF_BOT_TOKEN }} + operations-per-run: 75 days-before-stale: 120 days-before-pr-stale: -1 days-before-close: 21 @@ -39,6 +40,7 @@ jobs: - uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b # v7.0.0 with: repo-token: ${{ secrets.JF_BOT_TOKEN }} + operations-per-run: 75 days-before-stale: -1 days-before-close: 90 days-before-issue-close: -1 From 797b3138abdb8dcc5f95cf1502c98653fc94dc80 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 22 Mar 2023 12:57:03 -0400 Subject: [PATCH 5/5] Fix the stale action removing the merge conflict label when not fixed --- .github/workflows/repo-stale.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/repo-stale.yaml b/.github/workflows/repo-stale.yaml index 2c9bcf6e81..34b8976a1f 100644 --- a/.github/workflows/repo-stale.yaml +++ b/.github/workflows/repo-stale.yaml @@ -41,6 +41,8 @@ jobs: with: repo-token: ${{ secrets.JF_BOT_TOKEN }} operations-per-run: 75 + # The merge conflict action will remove the label when updated + remove-stale-when-updated: false days-before-stale: -1 days-before-close: 90 days-before-issue-close: -1