From 2751c5e3031d70accec7b752ba8e058e759c9cf1 Mon Sep 17 00:00:00 2001 From: appleboy Date: Sun, 29 Dec 2024 08:36:21 +0800 Subject: [PATCH] ci: add GitHub Actions workflow for Bearer PR check - 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 (read) and pull-requests (write) - Add a job to run on `ubuntu-latest` with steps to checkout repository, setup reviewdog, run Bearer report, and execute reviewdog with the report output 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