Skip to content

Commit

Permalink
github scripts and test workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Kingdon Barrett <[email protected]>
  • Loading branch information
Kingdon Barrett committed Aug 15, 2023
1 parent 4bfa1c8 commit 469b770
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/check_summary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

LINE_COUNT=$(wc -l < pr-summary.csv)

if [ "$LINE_COUNT" -gt 1 ]; then
echo "Issues found in PR. Attaching pr-summary.csv for review..."
else
echo "No direct issues found in PR. Attaching baseline-unresolved.csv for reference..."
fi
9 changes: 9 additions & 0 deletions .github/scripts/comment_on_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

LINE_COUNT=$(wc -l < pr-summary.csv)

if [ "$LINE_COUNT" -le 1 ]; then
# Using GitHub CLI to comment on the PR.
gh pr comment ${{ github.event.pull_request.number }} --body "Warning: Some unresolved baseline issues are present. Please check the attached baseline-unresolved.csv."
fi
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Action Workflow

on:
workflow_dispatch:
inputs:
prNumber:
description: 'PR number to test against'
required: true
default: '1573'

jobs:
test-action:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true

- name: Run the action
uses: ./action/
with:
token: ${{ secrets.GITHUB_TOKEN }}
prNumber: ${{ github.event.inputs.prNumber }}

0 comments on commit 469b770

Please sign in to comment.