mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
It is recommended to pin github actions with hash so that an action is not posing an unknown security risk (as the actions itself is not written by us). Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
40 lines
988 B
YAML
40 lines
988 B
YAML
name: Go Tidy
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '22 10 * * 3'
|
|
|
|
jobs:
|
|
fix:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492
|
|
with:
|
|
go-version: '1.17.0'
|
|
id: go
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
|
|
|
- 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
|