Skip to content

Commit d14873f

Browse files
Automatically create pull requests for directory updates (TheAlgorithms#6322)
1 parent 67ccb62 commit d14873f

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/update-directorymd.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate Directory Markdown
1+
name: Generate Directory Markdown
22

33
on:
44
push:
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
pull-requests: write
1011

1112
jobs:
1213
generate-directory:
@@ -22,12 +23,19 @@ jobs:
2223
extensions: .java
2324
show-extensions: false
2425

25-
- name: Commit and Push DIRECTORY.md
26+
- name: Commit changes
2627
run: |
27-
cat DIRECTORY.md
2828
git config --global user.name "$GITHUB_ACTOR"
2929
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
30-
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
3130
git add DIRECTORY.md
32-
git commit -am "Update directory" || true
33-
git push origin HEAD:$GITHUB_REF
31+
git diff --cached --quiet || git commit -m "Update DIRECTORY.md"
32+
33+
- name: Create Pull Request
34+
uses: peter-evans/create-pull-request@v5
35+
with:
36+
branch: update-directory
37+
base: master
38+
title: "Update DIRECTORY.md"
39+
body: "Automatically generated update of the directory tree."
40+
commit-message: "Update DIRECTORY.md"
41+
draft: false

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy