diff --git a/.github/scripts/check_summary.sh b/.github/scripts/check_summary.sh new file mode 100755 index 0000000..f5ee5a3 --- /dev/null +++ b/.github/scripts/check_summary.sh @@ -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 diff --git a/.github/scripts/comment_on_pr.sh b/.github/scripts/comment_on_pr.sh new file mode 100755 index 0000000..8336e70 --- /dev/null +++ b/.github/scripts/comment_on_pr.sh @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c64a26c --- /dev/null +++ b/.github/workflows/test.yml @@ -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 }}