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:
27
.github/workflows/contributors.yml
vendored
27
.github/workflows/contributors.yml
vendored
@@ -32,22 +32,19 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Check and report contributors
|
- name: Check contributors
|
||||||
|
id: contributors_check
|
||||||
|
run: npm run contributors:check
|
||||||
|
env:
|
||||||
|
PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Generate contributors report
|
||||||
|
if: steps.contributors_check.outcome == 'failure'
|
||||||
run: |
|
run: |
|
||||||
CHECK_OUTPUT=$(npm run contributors:check 2>&1)
|
mkdir -p reports
|
||||||
echo "$CHECK_OUTPUT"
|
npm run contributors:report
|
||||||
|
test -f reports/contributor-report.md && cat reports/contributor-report.md >> "$GITHUB_STEP_SUMMARY"
|
||||||
if echo "$CHECK_OUTPUT" | grep -q "Missing contributors"; then
|
|
||||||
echo "Missing contributors detected, generating report..."
|
|
||||||
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
|
|
||||||
env:
|
env:
|
||||||
PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
Reference in New Issue
Block a user