Skip to content

Commit 1960c6c

Browse files
committed
No screenshots on forks
Signed-off-by: Hannes Achleitner <[email protected]>
1 parent 2248a8f commit 1960c6c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎.github/workflows/BuildPR.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ jobs:
8383
8484
# Test (only on arm64 to avoid tripling CI time)
8585
- name: Prepare screenshot comparison
86-
if: ${{ always() && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
86+
if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
8787
run: brew install exiftool imagemagick
8888
- name: Checkout fixed repo snapshot for screenshots
89-
if: ${{ always() && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
89+
if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
9090
run: |
9191
git clone --no-checkout "$GITHUB_WORKSPACE" /tmp/gitx-screenshot-repo
9292
git -C /tmp/gitx-screenshot-repo checkout 52ff1051d0c8e5cf3ee5
9393
- name: Run tests
94-
if: ${{ always() && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
94+
if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
9595
run: |
9696
xcodebuild test \
9797
-workspace GitX.xcworkspace \
@@ -102,19 +102,19 @@ jobs:
102102
GITX_SCREENSHOT_REPO=/tmp/gitx-screenshot-repo \
103103
-resultBundlePath TestResults-${{ matrix.abi }}.xcresult
104104
- name: Extract screenshots from test results
105-
if: ${{ always() && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
105+
if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
106106
run: |
107107
python3 scripts/extract_screenshots.py \
108108
TestResults-${{ matrix.abi }}.xcresult \
109109
./scripts/screenshots-${{ matrix.abi }}
110110
- name: Upload screenshots
111-
if: ${{ always() && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
111+
if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
112112
uses: actions/upload-artifact@v7
113113
with:
114114
name: Screenshots-${{ matrix.abi }}
115115
path: ./scripts/screenshots-${{ matrix.abi }}
116116
- name: Compare screenshots
117-
if: ${{ github.event.repository.fork != true && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
117+
if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
118118
env:
119119
CLASSIC_TOKEN: ${{ secrets.CLASSIC_TOKEN }}
120120
SCREENSHOT_USER: ${{ secrets.SCREENSHOT_USER }}
@@ -124,7 +124,7 @@ jobs:
124124
ls -ls ./scripts/Screenshots-${{ matrix.abi }}
125125
./screenShotScript/screenShotCompare.sh false
126126
- name: Archive screenshots diffs
127-
if: ${{ always() && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
127+
if: ${{ env.variableSet != '' && matrix.abi == 'arm64' && github.event_name == 'pull_request' }}
128128
uses: actions/upload-artifact@v7
129129
with:
130130
name: gitx-Screenshots-diffs-${{ matrix.abi }}

0 commit comments

Comments
 (0)