Skip to content

Commit 7be7cfa

Browse files
Merge pull request #46531 from nextcloud/bugfix/noid/save-CI-time-for-forks
fix(CI): Skip some CI work from forks as they don't work anyway
2 parents 8c571dd + e40cc77 commit 7be7cfa

File tree

6 files changed

+48
-3
lines changed

6 files changed

+48
-3
lines changed

.github/workflows/command-compile.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ jobs:
2626
base_ref: ${{ steps.comment-branch.outputs.base_ref }}
2727

2828
steps:
29+
- name: Disabled on forks
30+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
31+
run: |
32+
echo 'Can not execute /compile on forks'
33+
exit 1
34+
2935
- name: Check actor permission
3036
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
3137
with:
@@ -57,6 +63,15 @@ jobs:
5763
uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v1
5864
id: comment-branch
5965

66+
- name: Add reaction on failure
67+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
68+
if: failure()
69+
with:
70+
token: ${{ secrets.COMMAND_BOT_PAT }}
71+
repository: ${{ github.event.repository.full_name }}
72+
comment-id: ${{ github.event.comment.id }}
73+
reactions: "-1"
74+
6075
process:
6176
runs-on: ubuntu-latest
6277
needs: init
@@ -95,7 +110,7 @@ jobs:
95110

96111
- name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }}
97112
run: npm i -g 'npm@${{ steps.package-engines-versions.outputs.npmVersion }}'
98-
113+
99114
- name: Rebase to ${{ needs.init.outputs.base_ref }}
100115
if: ${{ contains(needs.init.outputs.arg1, 'rebase') }}
101116
run: |
@@ -115,7 +130,7 @@ jobs:
115130
run: |
116131
git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
117132
git commit --signoff -m 'chore(assets): Recompile assets'
118-
133+
119134
- name: Commit fixup
120135
if: ${{ contains(needs.init.outputs.arg1, 'fixup') }}
121136
run: |
@@ -129,7 +144,7 @@ jobs:
129144
git commit --amend --no-edit --signoff
130145
# Remove any [skip ci] from the amended commit
131146
git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')"
132-
147+
133148
- name: Push normally
134149
if: ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }}
135150
run: git push origin '${{ needs.init.outputs.head_ref }}'

.github/workflows/command-pull-3rdparty.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
comment-id: ${{ github.event.comment.id }}
2828
reactions: '+1'
2929

30+
- name: Disabled on forks
31+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
32+
run: |
33+
echo 'Can not execute /update-3rdparty on forks'
34+
exit 1
35+
3036
- name: Init branch
3137
uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v1
3238
id: comment-branch

.github/workflows/cypress.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
PUPPETEER_SKIP_DOWNLOAD: true
3333

3434
steps:
35+
- name: Disabled on forks
36+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
37+
run: |
38+
echo 'Can not run cypress on forks'
39+
exit 1
40+
3541
- name: Checkout server
3642
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3743
with:

.github/workflows/dependabot-approve-merge.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
pull-requests: write
3232

3333
steps:
34+
- name: Disabled on forks
35+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
36+
run: |
37+
echo 'Can not approve PRs from forks'
38+
exit 1
39+
3440
# GitHub actions bot approve
3541
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
3642
with:

.github/workflows/performance.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
name: performance-${{ matrix.php-versions }}
2323

2424
steps:
25+
- name: Disabled on forks
26+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
27+
run: |
28+
echo 'Can not run performance tests on forks'
29+
exit 1
30+
2531
- name: Checkout server before PR
2632
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
2733
with:

.github/workflows/update-psalm-baseline-approve-merge.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
contents: write
2828

2929
steps:
30+
- name: Disabled on forks
31+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
32+
run: |
33+
echo 'Can not approve PRs from forks'
34+
exit 1
35+
3036
- uses: mdecoleman/pr-branch-name@bab4c71506bcd299fb350af63bb8e53f2940a599 # v2.0.0
3137
id: branchname
3238
with:

0 commit comments

Comments
 (0)