-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
- Loading branch information
Dave Henderson
committed
Jan 16, 2020
1 parent
fa8815e
commit e256066
Showing
1 changed file
with
36 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Tidy Go modules | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - .github/workflows/mod-tidy.yml | ||
| - go.mod | ||
| - go.sum | ||
|
|
||
| jobs: | ||
| tidy: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: hairyhenderson/gomplate-ci-build:latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v1 | ||
| - uses: actions/setup-go@v1 | ||
| with: | ||
| go-version: 1.13.x | ||
| - name: Reattach HEAD | ||
| run: git checkout ${GITHUB_REF#refs/heads/} | ||
| - name: Tidy | ||
| run: rm -f go.sum; go mod tidy | ||
| - name: Configure git | ||
| run: | | ||
| git config user.name "${GITHUB_ACTOR}" | ||
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git | ||
| - name: Commit and push changes | ||
| run: | | ||
| git add go.sum go.mod | ||
| if output=$(git status --porcelain) && [ ! -z "$output" ]; then | ||
| git commit -m 'chore(deps) Tidy go modules' | ||
| git push | ||
| fi |