github.com/Mrs4s/MiraiGo@v0.0.0-20240226124653-54bdd873e3fe/.github/workflows/goimports.yml (about)

     1  name: Goimports Style Fix
     2  
     3  on:
     4    push:
     5      branches: [ master ]
     6        
     7  jobs:
     8  
     9    build:
    10      name: Build
    11      runs-on: ubuntu-latest
    12      steps:
    13  
    14      - name: Set up Go 1.x
    15        uses: actions/setup-go@v2
    16        with:
    17          go-version: 1.19
    18  
    19      - name: Check out code into the Go module directory
    20        uses: actions/checkout@v2
    21  
    22      - name: Fix stylings
    23        run: |
    24          export PATH="$PATH:$GOPATH/bin"
    25          GO111MODULE=off go get golang.org/x/tools/cmd/goimports
    26          goimports -l -w ./
    27  
    28      - name: Commit back
    29        if: github.repository_owner == 'Mrs4s'
    30        continue-on-error: true
    31        run: |
    32          git config --local user.name 'github-actions[bot]'
    33          git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
    34          git add --all
    35          git commit -m "ci(chore): Fix stylings"
    36          git push
    37  
    38  #     - name: Test
    39  #       run: go test -v .