fix(deps): update module github.com/spf13/cobra to v1.8.0 #383
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: Format & Tidy go.mod | |
on: | |
pull_request: | |
paths: | |
- '**.go' | |
- '**.mod' | |
- 'Makefile' | |
- '.github/workflows/format-tidy.yml' | |
branches: | |
- 'main' | |
jobs: | |
cleanup-runs: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.owner.login == github.repository_owner | |
steps: | |
- uses: rokroskar/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
format: | |
name: format | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.owner.login == github.repository_owner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Format code | |
run: | |
make format | |
- name: Tidy go.mod | |
run: | |
make tidy | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v16 | |
id: verify-changed-files | |
with: | |
files: | | |
**/*.go | |
*.mod | |
*.sum | |
- name: Commit formatting changes | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add cmd ${{ steps.verify-changed-files.outputs.changed_files }} | |
git commit -m "Formatted code." | |
- name: Push formatting changes | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PAT_TOKEN }} | |
branch: ${{ github.head_ref }} |