mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 02:15:12 +00:00
ci(contributors): simplify contributor check using step outcome
- Replace brittle grep check with exit code-based branching - Use continue-on-error and conditional report generation Generated-by: GitHub Copilot <copilot@github.com> Signed-off-by: Ashley Childress <6563688+anchildress1@users.noreply.github.com>
This commit is contained in:
23
.github/workflows/contributors.yml
vendored
23
.github/workflows/contributors.yml
vendored
@@ -32,22 +32,19 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Check and report contributors
|
||||
run: |
|
||||
CHECK_OUTPUT=$(npm run contributors:check 2>&1)
|
||||
echo "$CHECK_OUTPUT"
|
||||
- name: Check contributors
|
||||
id: contributors_check
|
||||
run: npm run contributors:check
|
||||
env:
|
||||
PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
continue-on-error: true
|
||||
|
||||
if echo "$CHECK_OUTPUT" | grep -q "Missing contributors"; then
|
||||
echo "Missing contributors detected, generating report..."
|
||||
- name: Generate contributors report
|
||||
if: steps.contributors_check.outcome == 'failure'
|
||||
run: |
|
||||
mkdir -p reports
|
||||
npm run contributors:report
|
||||
|
||||
if [ -f reports/contributor-report.md ]; then
|
||||
cat reports/contributor-report.md >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
else
|
||||
echo "No missing contributors found"
|
||||
fi
|
||||
test -f reports/contributor-report.md && cat reports/contributor-report.md >> "$GITHUB_STEP_SUMMARY"
|
||||
env:
|
||||
PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
continue-on-error: true
|
||||
|
||||
Reference in New Issue
Block a user