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>
This commit is contained in:
Rak Laptudirm
2022-04-28 18:58:12 +05:30
committed by GitHub
parent 01db0fb369
commit e447b5545d
4 changed files with 331 additions and 354 deletions

View File

@ -1,10 +0,0 @@
if ! git diff --quiet DIRECTORY.md; then
echo Changes found, attempting to commit and push...
git add DIRECTORY.md
git commit -am "Auto-update DIRECTORY.md" || true
git push --force origin HEAD:$GITHUB_REF || true
echo ... done.
else
echo No changes found, exiting.
fi

View File

@ -35,7 +35,7 @@ function pathsToMarkdown (filePaths) {
for (let filepath of filePaths) {
let filename = path.basename(filepath)
filepath = path.dirname(path.sep)
filepath = path.dirname(filepath)
if (filepath !== oldPath) {
oldPath = printPath(oldPath, filepath, output)

View File

@ -3,8 +3,8 @@ name: Update Directory
on:
push:
branches:
- master
branches-ignore:
"master"
jobs:
updateDirectory:
@ -22,9 +22,16 @@ jobs:
- name: 🗄️ Create Directory from JS files
run: node .github/workflows/UpdateDirectory.mjs
- name: 🤓 Commit & push new Directory (if needed)
- name: Configure Github Action
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
- 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