build(deps): bump golang.org/x/net from 0.0.0-20220325170049-de3da57026de to 0.23.0 #21
Workflow file for this run
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
name: Code Formatter | |
on: | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
autoformat: | |
runs-on: ubuntu-latest | |
if: contains(github.event.pull_request.labels.*.name, 'autoformat') | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.14' | |
- name: Install goimports | |
run: go get golang.org/x/tools/cmd/goimports | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- run: goimports -w . | |
- run: go mod tidy | |
- name: Commit changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.FORMAT_TOKEN }} | |
run: | | |
git config user.name yoshi-automation | |
git config user.email [email protected] | |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
git add . | |
if [ -n "$(git status --porcelain)" ]; then | |
git commit --author "yoshi-automation <[email protected]>" --message "Run goimports and go mod tidy" | |
git push | |
fi | |
- name: Remove autoformat label | |
uses: actions/github-script@v2 | |
with: | |
github-token: ${{secrets.FORMAT_TOKEN}} | |
script: | | |
github.issues.removeLabel({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
name: 'autoformat' | |
}) |