48
48
required : false
49
49
default : ' '
50
50
type : string
51
+ go-mod-tidy :
52
+ description : Run `go mod tidy` after a merge
53
+ required : false
54
+ default : true
55
+ type : boolean
51
56
secrets :
52
57
cloner-app-id :
53
58
description : Github ID of cloner app
82
87
- name : Find github org name from repo name
83
88
id : org
84
89
run : |
85
- echo "upstream=$(dirname ${{ inputs.upstream }})" >> $GITHUB_OUTPUT
86
- echo "downstream=$(dirname ${{ inputs.downstream }})" >> $GITHUB_OUTPUT
87
- echo "sandbox=$(dirname ${{ inputs.sandbox }})" >> $GITHUB_OUTPUT
90
+ {
91
+ echo "upstream=$(dirname ${{ inputs.upstream }})"
92
+ echo "downstream=$(dirname ${{ inputs.downstream }})"
93
+ echo "sandbox=$(dirname ${{ inputs.sandbox }})"
94
+ } >> "$GITHUB_OUTPUT"
88
95
DOWNSTREAM_VERSION=$(curl -sL "https://raw.githubusercontent.com/${{ inputs.downstream }}/${{ inputs.downstream-branch }}/VERSION")
89
96
if [[ "${DOWNSTREAM_VERSION}" =~ ^$|"404: Not Found" ]]; then
90
97
# Strip the trailing URL from the expression.
@@ -101,7 +108,7 @@ jobs:
101
108
exit 1
102
109
fi
103
110
fi
104
- echo "downstream-version=${DOWNSTREAM_VERSION}" >> $GITHUB_OUTPUT
111
+ echo "downstream-version=${DOWNSTREAM_VERSION}" >> " $GITHUB_OUTPUT"
105
112
- uses : madhead/semver-utils@latest
106
113
id : version
107
114
with :
@@ -114,14 +121,14 @@ jobs:
114
121
SEMVER_RESULT="${{ steps.version.outputs.comparison-result }}"
115
122
echo "${{ inputs.downstream }}@${{ steps.org.outputs.downstream-version }} ${SEMVER_RESULT} ${{ inputs.upstream }}@${{ steps.upstream.outputs.release }}"
116
123
if [ "${SEMVER_RESULT}" == "<" ]; then
117
- echo "status=outdated" >> $GITHUB_OUTPUT
124
+ echo "status=outdated" >> " $GITHUB_OUTPUT"
118
125
echo "::notice::downstream outdated"
119
126
elif [ "${SEMVER_RESULT}" == "=" ]; then
120
- echo "status=uptodate" >> $GITHUB_OUTPUT
127
+ echo "status=uptodate" >> " $GITHUB_OUTPUT"
121
128
echo "::notice::downstream up-to-date"
122
129
exit 0
123
130
else
124
- echo "status=ahead" >> $GITHUB_OUTPUT
131
+ echo "status=ahead" >> " $GITHUB_OUTPUT"
125
132
echo "::notice::downstream ahead"
126
133
exit 0
127
134
fi
@@ -139,7 +146,7 @@ jobs:
139
146
- name : Merge with upstream ${{ steps.upstream.outputs.release }} tag
140
147
id : merge
141
148
run : |
142
- git merge -X theirs refs/tags/${{ steps.upstream.outputs.release }} --no-edit || echo 'MERGE_CONFLICT=true' >> $GITHUB_OUTPUT
149
+ git merge -X theirs refs/tags/${{ steps.upstream.outputs.release }} --no-edit || echo 'MERGE_CONFLICT=true' >> " $GITHUB_OUTPUT"
143
150
- name : Resolve conflict using upstream contents
144
151
if : ${{ steps.merge.outputs.MERGE_CONFLICT == 'true' && inputs.restore-upstream != ''}}
145
152
run : |
@@ -186,6 +193,7 @@ jobs:
186
193
with :
187
194
node-version : ${{ inputs.node-version }}
188
195
- name : go mod tidy + vendor
196
+ if : ${{ inputs.go-mod-tidy }}
189
197
run : |
190
198
go mod tidy
191
199
git add go.mod go.sum
0 commit comments