2323 pull-request-url :
2424 description : " URL of the created pull request"
2525 value : ${{ jobs.prepare-modules.outputs.pull-request-url }}
26+ pull-request-operation :
27+ description : " Pull request operation"
28+ value : ${{ jobs.prepare-modules.outputs.pull-request-operation }}
2629 inputs :
2730 target-tag :
2831 description : |
9093 pull-requests : write
9194 outputs :
9295 pull-request-url : ${{ steps.create-pull-request.outputs.pull-request-url }}
96+ pull-request-operation : ${{ steps.create-pull-request.outputs.pull-request-operation }}
9397 steps :
9498 -
9599 name : Checkout repository
@@ -136,10 +140,12 @@ jobs:
136140 for dir in "${ALL_FOLDERS[@]}"; do
137141 echo "::notice title=processing-module::Processing module in ${dir}"
138142 pushd "${dir}" > /dev/null
143+
139144 echo "Original go.mod"
140145 cat go.mod
141146
142- go mod download -x
147+ # Make sure we can get all dependencies
148+ go mod download
143149
144150 # List dependencies and update those matching the root module or sub-modules
145151 # This matches both the root module and any sub-modules under the same path.
@@ -155,6 +161,7 @@ jobs:
155161 sort -u | \
156162 grep "^${root_module}" | \
157163 grep -v "^${current_module}$" || true )
164+
158165 echo "Transformed go.mod"
159166 cat go.mod
160167
@@ -171,7 +178,7 @@ jobs:
171178 go work sync
172179 fi
173180
174- # Show what changed
181+ # Show what has changed
175182 echo "::notice title=changes::Git status after updates"
176183 git status --short
177184 -
@@ -218,6 +225,18 @@ jobs:
218225 sign-commits : ${{ inputs.enable-commit-signing }}
219226 signoff : true # DCO
220227
228+ no-change :
229+ needs : [prepare-modules]
230+ runs-on : ubuntu-latest
231+ if : ${{ needs.update-contributors.outputs.pull-request-operation == 'none' }}
232+ runs-on : ubuntu-latest
233+ steps :
234+ -
235+ name : Report no change needed
236+ run : |
237+ echo "::notice title=no-change::No change needed to the go.mod files"
238+ exit 0
239+
221240 auto-merge :
222241 # description: |
223242 # Approves the PR, waits for all jobs (including non-required ones), and enables auto-merge.
@@ -234,6 +253,7 @@ jobs:
234253 contents : write
235254 pull-requests : write
236255 runs-on : ubuntu-latest
256+ if : ${{ needs.prepare-modules.outputs.pull-request-operation != 'none' }}
237257 env :
238258 PR_URL : ${{ needs.prepare-modules.outputs.pull-request-url }}
239259 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments