7
7
types :
8
8
- published
9
9
10
+ # release published by workflow does not trigger above event;
11
+ # rather, we're triggered by this below
10
12
workflow_run :
11
13
workflows :
12
14
- publish
@@ -27,36 +29,43 @@ jobs:
27
29
28
30
outputs :
29
31
release-sha : ${{ steps.head.outputs.release-sha }}
30
- can-build : ${{ steps.success .outputs.can-build }}
32
+ can-build : ${{ steps.upstream .outputs.can-build }}
31
33
32
34
steps :
33
- - name : Check success
34
- id : success
35
+ - name : Check upstream success
36
+ id : upstream
35
37
env :
36
- CONCLUSION : ${{ github.event.workflow_run && github.event.workflow_run.conclusion || 'success ' }}
38
+ CONCLUSION : ${{ github.event.workflow_run && github.event.workflow_run.conclusion || 'na ' }}
37
39
run : |
38
- if [ "$CONCLUSION" = success ]
39
- then
40
- echo "publish successful"
41
- echo "can-build=true" >> $GITHUB_OUTPUT
42
- else
43
- echo "::error::publish not successful"
44
- echo "can-build=false" >> $GITHUB_OUTPUT
45
- fi
40
+ case "$CONCLUSION" in
41
+ success)
42
+ echo "upstream publish successful"
43
+ echo "can-build=true" >> $GITHUB_OUTPUT
44
+ ;;
45
+ na)
46
+ echo "no upstream workflow"
47
+ echo "can-build=true" >> $GITHUB_OUTPUT
48
+ ;;
49
+ *)
50
+ echo "::notice::upstream publish unsuccessful"
51
+ echo "can-build=false" >> $GITHUB_OUTPUT
52
+ ;;
53
+ esac
46
54
47
55
- name : Check out repository
48
- uses : actions/checkout@v3
49
- if : fromJSON(steps.success .outputs.can-build)
56
+ uses : actions/checkout@v4
57
+ if : fromJSON(steps.upstream .outputs.can-build)
50
58
with :
51
59
# fetch enough that we should feasibly be able to find this changeset
52
60
# and its subsequent tag commit (but without fetching *everything*)
53
61
ref : ${{ github.event.workflow_run.head_branch }}
54
62
fetch-depth : 100
63
+ # fetch tags s.t. we can interpret ref inputs on dispatch
55
64
fetch-tags : true
56
65
57
66
- name : Determine HEAD
58
67
id : head
59
- if : fromJSON(steps.success .outputs.can-build)
68
+ if : fromJSON(steps.upstream .outputs.can-build)
60
69
env :
61
70
HEAD_REF : ${{ inputs.head-ref }}
62
71
RUN_SHA : ${{ github.event.workflow_run.head_sha }}
92
101
93
102
delegate :
94
103
needs : [setup]
95
- uses : internet-equity/fate-pyz/.github/workflows/build-pyz.yml@0.6.7
104
+ uses : internet-equity/fate-pyz/.github/workflows/build-pyz.yml@0.6.8
96
105
if : fromJSON(needs.setup.outputs.can-build)
97
106
permissions :
98
107
contents : write
0 commit comments