Skip to content

Commit

Permalink
reverted workflow for testing
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Panayil <[email protected]>
  • Loading branch information
sachin-panayil committed Jan 23, 2025
1 parent e13f9e2 commit 13a76f4
Showing 1 changed file with 48 additions and 11 deletions.
59 changes: 48 additions & 11 deletions .github/workflows/send-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,57 @@
name: 'Create a PR based on validation'

on:
workflow_dispatch: {}
name: "Repository Hygiene Check"
on:
push:
branches:
- 'main'
workflow_dispatch:

jobs:
repolinter-action:
check-first-run:
name: Check For First Run
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- id: check
run: |
# If manually triggered, always run
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
exit 0
fi
# Check if initialization label exists
has_label=$(gh label list --json name | jq '.[] | select(.name=="repolinter-initialized")')
if [[ -z "$has_label" ]]; then
# First time - create label and allow run
gh label create repolinter-initialized --description "Marks repo as having run initial repolinter check"
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

repolinter-checks:
name: Tier 2 Checks
needs: check-first-run
if: needs.check-first-run.outputs.should_run == 'true'
runs-on: ubuntu-latest
name: Run Repolinter
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: 'Run Repolinter'
uses: DSACMS/repolinter-action@main
- uses: DSACMS/repolinter-action@main
with:
output_type: 'pull-request'
pull_request_labels: 'repolinter, cms-oss, cms-gov'
pull_request_labels: 'repolinter-initialized, cms-oss, cms-gov'
token: ${{ secrets.REPOLINTER_AUTO_TOKEN }}

0 comments on commit 13a76f4

Please sign in to comment.