Skip to content

Commit

Permalink
ci: add GitHub Actions workflow for Bearer PR checks
Browse files Browse the repository at this point in the history
- Add GitHub Actions workflow for Bearer PR checks
- Configure workflow to trigger on pull request events (opened, synchronize, reopened)
- Set permissions for contents (read) and pull-requests (write)
- Add job to run Bearer rule check on `ubuntu-latest`
- Include steps to checkout repository, set up reviewdog, run Bearer report, and run reviewdog with GitHub API token

Signed-off-by: appleboy <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Dec 28, 2024
1 parent 42a2378 commit 98f8b50
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/bearer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bearer PR Check

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

jobs:
rule_check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest

- name: Run Report
id: report
uses: bearer/bearer-action@v2
with:
format: rdjson
output: rd.json
diff: true

- name: Run reviewdog
if: always()
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cat rd.json | reviewdog -f=rdjson -reporter=github-pr-review

0 comments on commit 98f8b50

Please sign in to comment.