Skip to content

Commit

Permalink
Limit some workflows to main repository (#12097)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Oct 26, 2024
1 parent 61d342a commit 734ceec
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/assign-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
assign:
if: github.repository_owner == 'JabRef'
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:

jobs:
lychee:
if: github.repository_owner == 'JabRef'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/cleanup-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,14 @@ on:
jobs:
cleanup:
runs-on: ubuntu-latest
if: github.repository_owner == 'JabRef'
steps:
- name: Cancel deployment run
uses: styfle/[email protected]
with:
ignore_sha: true
workflow_id: 9813 # workflow "Deployment"
- name: Check secrets presence
id: checksecrets
shell: bash
run: |
if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then
echo "secretspresent=NO" >> $GITHUB_OUTPUT
echo "❌ Secret BUILDJABREFPRIVATEKEY not present"
else
echo "secretspresent=YES" >> $GITHUB_OUTPUT
echo "✔️ Secret BUILDJABREFPRIVATEKEY present"
fi
env:
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
- name: Delete folder on builds.jabref.org
if: steps.checksecrets.outputs.secretspresent == 'YES'
uses: appleboy/[email protected]
with:
script: rm -rf /var/www/builds.jabref.org/www/pull/${{ github.event.pull_request.number }} || true
Expand All @@ -36,7 +23,6 @@ jobs:
username: jrrsync
key: ${{ secrets.buildJabRefPrivateKey }}
- name: Update PR comment
if: steps.checksecrets.outputs.secretspresent == 'YES'
uses: thollander/actions-comment-pull-request@v3
with:
comment-tag: download-link
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ concurrency:

jobs:
build:
if: github.repository_owner == 'JabRef'
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deployment-jdk-ea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ concurrency:

jobs:
build:
if: github.repository_owner == 'JabRef'
strategy:
fail-fast: false
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ concurrency:

jobs:
action:
if: github.repository_owner == 'JabRef'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/on-labeled-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
Assigned:
# Triggered when manually assigned the label "📍 Assigned" to trigger the automatic unassignment after 30 days
name: "📍 Assigned"
if: ${{ github.event.label.name == '📍 Assigned' }}
if: ${{ github.event.label.name == '📍 Assigned' && github.repository_owner == 'JabRef' }}
runs-on: ubuntu-latest
permissions:
issues: write
Expand All @@ -35,7 +35,7 @@ jobs:
default-column: "Free to take"
skip-if-not-in-project: true
FirstTimeCodeContribution:
if: ${{ github.event.label.name == 'FirstTimeCodeContribution' }}
if: ${{ github.event.label.name == 'FirstTimeCodeContribution' && github.repository_owner == 'JabRef' }}
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
skip-if-not-in-project: true
good-first-issue:
name: "good first issue"
if: "${{ github.event.label.name == 'good first issue' }}"
if: "${{ github.event.label.name == 'good first issue' && github.repository_owner == 'JabRef' }}"
runs-on: ubuntu-latest
steps:
- name: "good first issue"
Expand All @@ -90,7 +90,7 @@ jobs:
ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH")
gh project item-add 5 --owner JabRef --url $ISSUE_URL
needs-refinement:
if: github.event.label.name == 'needs-refinement'
if: github.event.label.name == 'needs-refinement' && github.repository_owner == 'JabRef'
runs-on: ubuntu-latest
steps:
- name: needs-refinement
Expand All @@ -101,7 +101,7 @@ jobs:
gh project item-add 15 --owner JabRef --url $ISSUE_URL
status-freeze:
name: "status: freeze"
if: "${{ github.event.label.name == 'status: freeze' }}"
if: "${{ github.event.label.name == 'status: freeze' && github.repository_owner == 'JabRef' }}"
runs-on: ubuntu-latest
steps:
- name: "status: freeze"
Expand All @@ -111,7 +111,7 @@ jobs:
ISSUE_URL=$(jq --raw-output .issue.html_url "$GITHUB_EVENT_PATH")
gh project item-add 9 --owner JabRef --url $ISSUE_URL
ui:
if: "${{ github.event.label.name == 'ui' }}"
if: "${{ github.event.label.name == 'ui' && github.repository_owner == 'JabRef' }}"
runs-on: ubuntu-latest
steps:
- name: ui
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
automerge:
name: Auto Merge
if: "${{ github.event.label.name == 'automerge' }}"
if: "${{ github.event.label.name == 'automerge' && github.repository_owner == 'JabRef' }}"
runs-on: ubuntu-latest
steps:
- name: Approve PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-unlabeled-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
FirstTimeCodeContribution_or_Assigned:
if: ${{ (github.event.label.name == 'FirstTimeCodeContribution') || (github.event.label.name == '📍 Assigned') }}
if: ${{ ((github.event.label.name == 'FirstTimeCodeContribution') || (github.event.label.name == '📍 Assigned')) && github.repository_owner == 'JabRef' }}
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
comment:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
if: ${{ github.event.workflow_run.conclusion == 'failure' && (github.repository_owner == 'JabRef') }}
runs-on: ubuntu-latest
permissions:
actions: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-gradle-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
update-gradle-wrapper:
if: github.repository_owner == 'JabRef'
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit 734ceec

Please sign in to comment.