Skip to content

Commit 66a0116

Browse files
committed
fix(github-pages): only upload on official repo
When users fork this repo and try to contribute, the CI was trying to run the pages related commands on the fork. Change this so that it only tries to run on the official repo so contributors do not get spammed with failures from their own forks.
1 parent 01c23b2 commit 66a0116

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
cache: pnpm
3434

3535
- name: Setup Pages
36+
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' && github.repository == 'connectbot/connectbot.github.io'
3637
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
3738

3839
- name: Restore cache
@@ -57,7 +58,7 @@ jobs:
5758
run: pnpm run build
5859

5960
- name: Upload artifact
60-
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
61+
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' && github.repository == 'connectbot/connectbot.github.io'
6162
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
6263
with:
6364
path: ./out
@@ -68,7 +69,7 @@ jobs:
6869
url: ${{ steps.deployment.outputs.page_url }}
6970
runs-on: ubuntu-latest
7071
needs: build
71-
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
72+
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' && github.repository == 'connectbot/connectbot.github.io'
7273
steps:
7374
- name: Deploy to GitHub Pages
7475
id: deployment

0 commit comments

Comments
 (0)