Files
JavaScript/.github/workflows/UpdateDirectory.yml
Rak Laptudirm e447b5545d merge: Update directory workflow (#1000)
* chore: update directory workflow

Workflow now only runs on `pull_request` to prevent pushing on the master branch.

* chore: update commit mechanism

* chore: remove rundundant script

* Update UpdateDirectory.yml

* Updated Documentation in README.md

* Update UpdateDirectory.yml

* fix: replace wrong variable

* Updated Documentation in README.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-04-28 18:58:12 +05:30

38 lines
996 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@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: Configure Github Action
run: |
git config --global user.name github-actions
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