mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
39 lines
993 B
YAML
39 lines
993 B
YAML
# This GitHub Action updates the DIRECTORY.md file (if needed) when doing a git push
|
|
name: Update Directory
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
"master"
|
|
|
|
jobs:
|
|
updateDirectory:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
|
|
- name: 📦 Install dependencies
|
|
run: npm ci
|
|
|
|
- name: 🗄️ Create Directory from JS files
|
|
run: node .github/workflows/UpdateDirectory.js
|
|
|
|
- name: Configure Github Action
|
|
run: |
|
|
git config --global user.name "$GITHUB_ACTOR"
|
|
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
|
|
- name: 🤓 Commit & push new Directory (if needed)
|
|
run: |
|
|
if [[ `git status --porcelain` ]]; then
|
|
git commit -am "Updated Documentation in README.md"
|
|
git push
|
|
else
|
|
echo "NO CHANGES DETECTED"
|
|
fi
|