Skip to content

changed workflow

changed workflow #99

name: "run-linting-checks"
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
check-existing-pr:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- id: check
run: |
# Check if there are any open PRs from this workflow
pr_count=$(gh pr list --search "repolinter in:title" --json number | jq length)
if [[ $pr_count -eq 0 ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
resolve-repolinter-json:
needs: check-existing-pr
if: needs.check-existing-pr.outputs.should_run == 'true'
uses: DSACMS/repo-scaffolder/.github/workflows/extendJSONFile.yml@main
with:
url_to_json: 'https://raw.githubusercontent.com/DSACMS/repo-scaffolder/main/tier3/%7B%7Bcookiecutter.project_slug%7D%7D/repolinter.json'
repolinter-checks:
name: Tier 3 Checks
needs: [check-existing-pr, resolve-repolinter-json]
if: needs.check-existing-pr.outputs.should_run == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
RAW_JSON: ${{ needs.resolve-repolinter-json.outputs.raw-json }}
steps:
- uses: actions/checkout@v4
- run: echo $RAW_JSON > repolinter.json
- uses: DSACMS/repolinter-action@main
with:
config_file: 'repolinter.json'
output_type: 'pull-request'
pull_request_labels: 'repolinter, cms-oss, cms-gov'
token: ${{ secrets.REPOLINTER_AUTO_TOKEN }}