mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
name: Populate readme.md from master and lint src/data.js
|
|
|
|
on:
|
|
push:
|
|
branches: master
|
|
paths:
|
|
- src/data.js
|
|
- scripts/readme-template.md
|
|
|
|
env:
|
|
CI: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 16.x
|
|
|
|
- name: Cache/Restore node modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
|
|
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
|
|
- name: Lint src/data.js
|
|
run: |
|
|
npx eslint --fix src/data.js
|
|
git add src/data.js
|
|
|
|
- name: Populate readme.md from master
|
|
run: |
|
|
node ./scripts/populate-readme.js
|
|
mv generated-readme.md readme.md
|
|
git add readme.md
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
# commit only if any changes
|
|
if [ ! -z "$(git status --porcelain)" ]; then
|
|
git commit -m "chore: generate \`readme.md\`, lint \`src/data.js\`"
|
|
fi
|
|
|
|
- name: Push changes
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|