DSACMS / metrics

Experimentations in Open Source Repository Metrics
https://dsacms.github.io/metrics/
Other
6 stars 2 forks source link

Create GitHub Workflow to Run Custom Checks on PR Creation #65

Closed IsaacMilarky closed 9 months ago

IsaacMilarky commented 9 months ago

Create GitHub Workflow to Run Custom Checks on PR Creation

Problem

Before, linting and other checking wasn't done automatically when a pull-request was created.

Solution

When a pull request is created, a github action is triggered to run a set of checks on the corresponding git branch. The first of which, called run-pylint, runs pylint, stores the resulting json in a variable, and passes that variable to some check annotations. This job basically adds pylint annotations to a branch automatically when a PR is opened.

NOTE: I have tested this with the on: push trigger since It's better to test that way. According to https://github.com/LouisBrunner/checks-action/issues/12 the action should behave the same when used with the on: pull_request trigger.

Result:

Screen Shot 2023-12-05 at 2 45 47 PM
IsaacMilarky commented 9 months ago

When I get the chance I plan to also do this for repolinter for automatic repo linting. That is something that can be used more broadly though so it might be worth it to host that somewhere separately. Keeping this PR small

IsaacMilarky commented 9 months ago

Tagging @decause-gov because this pr might be relevant to this issue: https://github.cms.gov/DSAC/ospo/issues/26