Files
awesome-copilot/.github/workflows/contributors.yml
Ashley Childress f9e981e4cd fix(contributors): address Copilot review comments and code quality issues
- Improve contributor-report.mjs based on Copilot comments and sonar
- Use fileURLToPath for Windows-safe main checks in contributor scripts
- Fix README badge URLs by removing duplicate style parameters
- Update graceful-shutdown.mjs to throw on process.exit failure for better error visibility

Generated-by: GitHub Copilot <copilot@github.com>
Signed-off-by: Ashley Childress <6563688+anchildress1@users.noreply.github.com>
2026-01-15 08:54:51 -05:00

88 lines
2.6 KiB
YAML

name: Contributors
on:
schedule:
- cron: '0 3 * * 0' # Weekly on Sundays at 3am UTC
workflow_dispatch: # Manual trigger
jobs:
contributors:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Required: add-missing-contributors.js needs full git history
- name: Extract Node version from package.json
id: node-version
run: |
NODE_VERSION=$(jq -r '.engines.node // "22.x"' package.json)
echo "version=${NODE_VERSION}" >> "$GITHUB_OUTPUT"
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ steps.node-version.outputs.version }}
- name: Install dependencies
run: npm ci
- name: Check and report contributors
run: |
CHECK_OUTPUT=$(npm run contributors:check 2>&1)
echo "$CHECK_OUTPUT"
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:
PRIVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Regenerate README
run: npm start
- name: Check for changes
id: verify-changed-files
run: |
if git diff --exit-code > /dev/null; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Commit contributors
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "docs: update contributors" -a || exit 0
- name: Create Pull Request
if: steps.verify-changed-files.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update contributors"
title: "Update Contributors"
body: |
Auto-generated PR to update contributors.
This PR was automatically created by the contributors workflow.
branch: update-contributors
delete-branch: true