30
30
# Determine whether the target branch is master (i.e. this is a push to
31
31
# master or a PR to master).
32
32
TARGET_IS_MASTER : ${{ (github.event_name == 'push' && github.ref_name == 'master') || (github.event_name == 'pull_request' && github.base_ref == 'master') }}
33
+ IS_PR_FROM_FORK : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
33
34
# Disable precompilation as it takes a long time and is not needed for this workflow
34
35
JULIA_PKG_PRECOMPILE_AUTO : 0
35
36
@@ -46,14 +47,16 @@ jobs:
46
47
echo github.ref_name: ${{ github.ref_name }}
47
48
echo github.base_ref: ${{ github.base_ref }}
48
49
echo TARGET_IS_MASTER: ${{ env.TARGET_IS_MASTER }}
50
+ echo IS_PR_FROM_FORK: ${{ env.IS_PR_FROM_FORK }}
49
51
50
52
- name : Check version consistency
53
+ id : version_check
51
54
continue-on-error : true
52
55
run : julia --color=yes .github/workflows/version_check.jl
53
56
54
57
- name : Create a PR with suggested changes
55
58
id : create_pr
56
- if : env.TARGET_IS_MASTER
59
+ if : steps.version_check.outcome == 'failure' && env.TARGET_IS_MASTER && (! env.IS_PR_FROM_FORK)
57
60
uses : peter-evans/create-pull-request@v6
58
61
with :
59
62
base : ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
62
65
body : " This PR is automatically generated by the `version_check.yml` GitHub Action."
63
66
title : " Update Turing.jl version to match latest release"
64
67
65
- - name : Comment on PR about suggested changes
66
- if : ${{ github.event_name == 'pull_request' && steps.create_pr.outputs.pull-request-operation == 'created' }}
68
+ - name : Comment on PR about suggested changes (if PR was made)
69
+ if : github.event_name == 'pull_request' && steps.create_pr.outputs.pull-request-operation == 'created'
67
70
uses : thollander/actions-comment-pull-request@v2
68
71
with :
69
72
message : |
0 commit comments