Files
miti99/.github/workflows/update-projects.yml
T
tiennm99 a396c1fb40 refactor(scripts): unify module extensions on .js
The root package.json already declares "type": "module", so a .js file here is
ESM and the .mjs suffix only restates what the manifest states. Renames the three
GitHub Actions scripts and follows every reference, including the six JSDoc
import("...") type annotations that would otherwise degrade to any without
throwing.
2026-09-18 16:23:36 +07:00

54 lines
1.3 KiB
YAML

name: Update projects list
on:
schedule:
# 00:00 Asia/Saigon (UTC+7) = 17:00 UTC
- cron: "0 17 * * *"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: update-projects
cancel-in-progress: false
jobs:
update:
runs-on: ubuntu-latest
env:
TZ: Asia/Ho_Chi_Minh
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Use PAT so the subsequent commit+push triggers the build workflow.
token: ${{ secrets.PAGES_FETCH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Refresh projects list
env:
GH_TOKEN: ${{ secrets.PAGES_FETCH_TOKEN }}
GH_USER: tiennm99
run: node .github/scripts/update-projects-list.js
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add content/page/projects/index.md
if git diff --cached --quiet; then
echo "No changes to commit."
exit 0
fi
git commit -m "chore(projects): refresh projects list"
git push