Files
coredns/.github/workflows/go.fmt.yml
dependabot[bot] 267ce8a820 build(deps): bump actions/checkout from 2.4.0 to 3 (#5238)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](ec3a7ce113...a12a3943b4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 07:05:33 -08:00

37 lines
925 B
YAML

name: Go Fmt
on:
schedule:
- cron: '22 10 * * 1'
permissions: read-all
jobs:
fix:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Fmt
run: |
find . -not -path '*/\.git/*' -type f -name '*.go' -exec gofmt -s -w {} \+
- 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 fmt'
git push
fi