mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-07 17:56:02 +08:00
Automatically create pull requests for directory updates (#6322)
This commit is contained in:
20
.github/workflows/update-directorymd.yml
vendored
20
.github/workflows/update-directorymd.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Generate Directory Markdown
|
name: Generate Directory Markdown
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -7,6 +7,7 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate-directory:
|
generate-directory:
|
||||||
@ -22,12 +23,19 @@ jobs:
|
|||||||
extensions: .java
|
extensions: .java
|
||||||
show-extensions: false
|
show-extensions: false
|
||||||
|
|
||||||
- name: Commit and Push DIRECTORY.md
|
- name: Commit changes
|
||||||
run: |
|
run: |
|
||||||
cat DIRECTORY.md
|
|
||||||
git config --global user.name "$GITHUB_ACTOR"
|
git config --global user.name "$GITHUB_ACTOR"
|
||||||
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
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
|
|
||||||
git add DIRECTORY.md
|
git add DIRECTORY.md
|
||||||
git commit -am "Update directory" || true
|
git diff --cached --quiet || git commit -m "Update DIRECTORY.md"
|
||||||
git push origin HEAD:$GITHUB_REF
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@v5
|
||||||
|
with:
|
||||||
|
branch: update-directory
|
||||||
|
base: master
|
||||||
|
title: "Update DIRECTORY.md"
|
||||||
|
body: "Automatically generated update of the directory tree."
|
||||||
|
commit-message: "Update DIRECTORY.md"
|
||||||
|
draft: false
|
||||||
|
Reference in New Issue
Block a user