Skip to content

Commit

Permalink
ci: run merge conflict detection on pull requests too
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Fernández <[email protected]>
  • Loading branch information
ferferga committed Sep 11, 2024
1 parent 048e80e commit 32fd720
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/__automation.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
dirtyLabel: "merge conflict"
repoToken: ${{ secrets.JF_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/__codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
type: string
jobs:
analyze:
name: Analyze ${{ matrix.language}} 🔬
name: Analyze ${{ matrix.language }} 🔬
runs-on: ubuntu-latest

strategy:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ 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:
commit: ${{ github.event.pull_request.head.sha }}
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:
Expand Down Expand Up @@ -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
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/push_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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 🏷️✅' }}
Expand All @@ -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 🔬
Expand All @@ -54,6 +48,7 @@ jobs:

deploy:
name: Deploy 🚀
if: ${{ github.repository == 'jellyfin/jellyfin-vue' }}
uses: ./.github/workflows/__deploy.yml
needs:
- main
Expand Down

0 comments on commit 32fd720

Please sign in to comment.