Skip to content

Commit

Permalink
workflows: rstcheck: add a check to catch new issues
Browse files Browse the repository at this point in the history
Use the delta function with rstcheck to check for any new errors being
introduced by a PR.

Signed-off-by: Randolph Sapp <[email protected]>
  • Loading branch information
StaticRocket committed Oct 22, 2024
1 parent dcfcfaa commit c45ef78
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/rstcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: "rstcheck"

on:
pull_request:
branches: [master]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
container:
image: ghcr.io/texasinstruments/processor-sdk-doc:latest
createOptions: "--entrypoint /bin/sh"
permissions:
contents: read
issues: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run rstcheck
run: |
git config --global --add safe.directory $PWD
bin/delta.sh -a $GITHUB_BASE_REF -b $GITHUB_SHA \
-- rstcheck -r source/
echo "new_warnings="$(cat _new-warn.log)""_new-warn.log >> $GITHUB_ENV
- name: Update pr with info
uses: actions/github-script@v7
if: failure()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
issue_number: context.issue.number,
repo: context.repo.repo,
body: process.env.new_warnings
})

0 comments on commit c45ef78

Please sign in to comment.