Skip to content

Automatically create pull requests for directory updates #6322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .github/workflows/update-directorymd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate Directory Markdown
name: Generate Directory Markdown

on:
push:
Expand All @@ -7,6 +7,7 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
generate-directory:
Expand All @@ -22,12 +23,19 @@ jobs:
extensions: .java
show-extensions: false

- name: Commit and Push DIRECTORY.md
- name: Commit changes
run: |
cat DIRECTORY.md
git config --global user.name "$GITHUB_ACTOR"
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 commit -am "Update directory" || true
git push origin HEAD:$GITHUB_REF
git diff --cached --quiet || git commit -m "Update DIRECTORY.md"

- 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
Loading