Files
coredns/.github/workflows/go.tidy.yml
2022-03-18 03:37:51 -07:00

44 lines
1.0 KiB
YAML

name: Go Tidy
on:
schedule:
- cron: '22 10 * * 3'
permissions: read-all
jobs:
fix:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install Go
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab
with:
go-version: '1.18.0'
id: go
- name: Checkout
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Tidy
run: |
rm -f go.sum
go mod tidy
- name: Set up Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "coredns[bot]"
git config user.email "bot@bot.coredns.io"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: Commit and push changes
run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit -s -m 'auto go mod tidy'
git push
fi