From 7a4cab388b562fbb8dfac4a73f025c1555fb4814 Mon Sep 17 00:00:00 2001 From: appleboy Date: Sun, 29 Dec 2024 07:43:56 +0800 Subject: [PATCH] ci: add GitHub Actions workflow for Bearer PR checks - Add a GitHub Actions workflow for Bearer PR Check - Configure the workflow to trigger on pull request events [opened, synchronize, reopened] - Set permissions for contents to read and pull-requests to write - Define a job named `rule_check` that runs on `ubuntu-latest` - Include steps to checkout the repository, set up reviewdog, run Bearer report, and execute reviewdog Signed-off-by: appleboy --- .github/workflows/bearer.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/bearer.yml diff --git a/.github/workflows/bearer.yml b/.github/workflows/bearer.yml new file mode 100644 index 0000000..8dd39ab --- /dev/null +++ b/.github/workflows/bearer.yml @@ -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