-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add presubmit-go-mod-vendor workflow
adds a gate to ensure all dependency vendoring is up to date Signed-off-by: Caleb Woodbine <[email protected]>
- Loading branch information
1 parent
00463f9
commit 0770f4f
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: reusable presubmit go mod vendor | ||
on: | ||
workflow_call: {} | ||
jobs: | ||
presubmit-go-mod-vendor: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 | ||
with: | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
- name: run go mod vendor | ||
run: | | ||
go mod vendor -v | ||
- id: changes | ||
name: determine changes | ||
run: | | ||
git add --all ./vendor | ||
if ( git ls-files --other --directory --exclude-standard | grep 'vendor/' || git diff --name-only --diff-filter=ACMRT | grep 'vendor/' ); then | ||
echo "changes=true" >> $GITHUB_OUTPUT | ||
fi | ||
- if: ${{ steps.changes.outputs.changes == 'true' }} | ||
env: | ||
READMEPATH: ${{ inputs.readmePath }} | ||
run: | | ||
echo "changes detected" >/dev/stderr | ||
echo "Please run 'git add --all ./vendor/' to add all vendor changes and commit again." | ||
exit 1 |