Skip to content

Commit

Permalink
Add betteralign to gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwilljones committed Aug 19, 2024
1 parent 612786b commit a15845b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
pull-requests: write # for betteralign to comment on PR
checks: write # for golangci/golangci-lint-action to annotate Pull Requests
name: Lint Go code
runs-on: ubuntu-latest
Expand All @@ -27,6 +27,23 @@ jobs:
version: v1.54
args: --timeout 10m --exclude SA5011 --verbose --issues-exit-code=0
only-new-issues: true
- name: Run betteralign
id: betteralign
run: |
go install github.com/dkorunic/betteralign/cmd/betteralign@latest
betteralign ./... >> $BETTERALIGN_OUTPUT
- uses: actions/github-script@v7
with:
script: |
const output = `#### Betteralign 🤖\`${{ steps.betteralign.outputs.BETTERALIGN_OUTPUT }}\`
*Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
test:
name: Run unit tests for Go packages
Expand Down

0 comments on commit a15845b

Please sign in to comment.