From 32fd720f7205067577f27943f65c080dcff1f4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Thu, 12 Sep 2024 01:53:42 +0200 Subject: [PATCH] ci: run merge conflict detection on pull requests too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fernando FernΓ‘ndez --- .github/workflows/__automation.yml | 17 +++++++++++++++++ .github/workflows/__codeql.yml | 2 +- .github/workflows/pull_request.yml | 12 +++++++++--- .github/workflows/push_release.yml | 19 +++++++------------ 4 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/__automation.yml diff --git a/.github/workflows/__automation.yml b/.github/workflows/__automation.yml new file mode 100644 index 00000000000..e5953972437 --- /dev/null +++ b/.github/workflows/__automation.yml @@ -0,0 +1,17 @@ +name: Automation πŸŽ›οΈ + +on: + workflow_call: + +jobs: + label: + name: Label conflicted PRs πŸ·οΈβ›” + if: ${{ always() && !cancelled() }} + runs-on: ubuntu-latest + + steps: + - name: Check all PRs for merge conflicts and label them β›” + uses: eps1lon/actions-label-merge-conflict@v3.0.2 + with: + dirtyLabel: "merge conflict" + repoToken: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/__codeql.yml b/.github/workflows/__codeql.yml index 633d37ecd23..f1e3ec6e50e 100644 --- a/.github/workflows/__codeql.yml +++ b/.github/workflows/__codeql.yml @@ -8,7 +8,7 @@ on: type: string jobs: analyze: - name: Analyze ${{ matrix.language}} πŸ”¬ + name: Analyze ${{ matrix.language }} πŸ”¬ runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a35fc7244d5..278449a2a1d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -13,7 +13,7 @@ on: jobs: push-comment: name: Create comments ✍️ - if: ${{ always() && !cancelled() }} + if: ${{ always() && !cancelled() && github.repository == 'jellyfin/jellyfin-vue' }} uses: ./.github/workflows/__job_messages.yml secrets: inherit with: @@ -21,9 +21,15 @@ jobs: in_progress: true comment: true + automation: + name: Automation πŸŽ›οΈ + if: ${{ github.repository == 'jellyfin/jellyfin-vue' }} + uses: ./.github/workflows/__automation.yml + secrets: inherit + label: name: Labeling 🏷️ - if: ${{ always() }} + if: ${{ always() && github.repository == 'jellyfin/jellyfin-vue'}} runs-on: ubuntu-latest steps: @@ -66,7 +72,7 @@ jobs: deploy: name: Deploy πŸš€ uses: ./.github/workflows/__deploy.yml - if: ${{ always() && !cancelled() && needs.build.result == 'success' }} + if: ${{ always() && !cancelled() && needs.build.result == 'success' && github.repository == 'jellyfin/jellyfin-vue' }} needs: - push-comment - build diff --git a/.github/workflows/push_release.yml b/.github/workflows/push_release.yml index 664427ff5b5..69668890a7c 100644 --- a/.github/workflows/push_release.yml +++ b/.github/workflows/push_release.yml @@ -16,17 +16,11 @@ on: - '**/*.md' jobs: - label: - name: Label conflicted PRs πŸ·οΈβ›” - if: ${{ always() && !cancelled() }} - runs-on: ubuntu-latest - - steps: - - name: Check all PRs for merge conflicts and label them β›” - uses: eps1lon/actions-label-merge-conflict@v3.0.2 - with: - dirtyLabel: "merge conflict" - repoToken: ${{ secrets.JF_BOT_TOKEN }} + automation: + name: Automation πŸŽ›οΈ + if: ${{ github.repository == 'jellyfin/jellyfin-vue' }} + uses: ./.github/workflows/__automation.yml + secrets: inherit main: name: ${{ github.event_name == 'push' && 'Unstable πŸš€βš οΈ' || 'Stable πŸ·οΈβœ…' }} @@ -40,7 +34,7 @@ jobs: commit: ${{ github.event_name == 'push' && github.sha }} is_prerelease: ${{ github.event_name == 'release' && github.event.action == 'prereleased' }} tag_name: ${{ github.event_name == 'release' && github.event.release.tag_name }} - push: true + push: ${{ github.repository == 'jellyfin/jellyfin-vue' }} codeql: name: GitHub CodeQL πŸ”¬ @@ -54,6 +48,7 @@ jobs: deploy: name: Deploy πŸš€ + if: ${{ github.repository == 'jellyfin/jellyfin-vue' }} uses: ./.github/workflows/__deploy.yml needs: - main