forked from TheAlgorithms/JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (25 loc) · 904 Bytes
/
UpdateDirectory.yml
File metadata and controls
30 lines (25 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# This GitHub Action updates the DIRECTORY.md file (if needed) when doing a git push
name: Update Directory
on:
push:
branches:
- master
jobs:
updateDirectory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
cache: npm
- name: 📦 Install dependencies
run: npm ci
- name: 🗄️ Create Directory from JS files
run: node .github/workflows/UpdateDirectory.mjs
- name: 🤓 Commit & push new Directory (if needed)
run: |
git config --global user.name github-actions
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
.github/workflows/CommitAndPushDirectory.sh