File tree Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change 24
24
LOCALE_ID : ' en-US'
25
25
26
26
jobs :
27
- check-run :
27
+ ci-conditions :
28
+ name : ' CI conditions'
28
29
runs-on : ' ubuntu-latest'
29
30
outputs :
30
- should-skip : ${{ steps.check.outputs.should-skip }}
31
+ IS_FORK : ${{ github.repository_owner != 'getodk' }}
32
+ IS_PR : ${{ github.event_name == 'pull_request' }}
33
+
31
34
steps :
32
- - name : Check for duplicate push event with PR
33
- id : check
34
- if : github.event_name == 'push'
35
- run : |
36
- # Check if this push is tied to an open PR
37
- PR_NUMBER=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
38
- "https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" | \
39
- jq -r '.[0].number // "none"')
40
- if [ "$PR_NUMBER" != "none" ]; then
41
- echo "This push (commit ${{ github.sha }}) is part of PR #$PR_NUMBER, skipping to avoid duplication with pull_request event."
42
- echo "should-skip=true" >> $GITHUB_OUTPUT
43
- exit 0
44
- else
45
- echo "No associated PR found, proceeding with CI for this push."
46
- echo "should-skip=false" >> $GITHUB_OUTPUT
47
- fi
35
+ - name : Capture CI conditions
36
+ id : capture-ci-conditions
37
+ run : exit 0
48
38
49
39
install-and-build :
50
- needs : check-run
51
- if : ${{ needs.check-run .outputs.should-skip ! = 'true' }}
40
+ needs : ci-conditions
41
+ if : ${{ needs.ci-conditions .outputs.IS_PR != 'true' || needs.ci-conditions.outputs.IS_FORK = = 'true' }}
52
42
name : ' Install dependencies and build packages'
53
43
runs-on : ' ubuntu-latest'
54
44
You can’t perform that action at this time.
0 commit comments