Update #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update | |
# Controls when the workflow will run | |
on: | |
schedule: | |
# run at 4 am first day of week: | |
- cron: '0 4 * * 1' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./js | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
# setup node | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
# retrieve pkg metadata | |
- name: get_metadata | |
run: node get_metadata.js | |
env: | |
GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }} | |
# aggregate metadata | |
- name: aggregate_metadata | |
run: node aggregate_metadata.js | |
# generate readme | |
- name: generate_readme_csv | |
run: node generate_readme_csv.js | |
# Commit files: | |
- name: Commit files | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add ../metadata/ | |
git commit -a -m "Add changes" --allow-empty | |
# push changes: | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |