Update update-directorymd.yml #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate Directory Markdown | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate-directory: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Run Directory Tree Generator | |
| uses: DenizAltunkapan/directory-tree-generator@v2 | |
| with: | |
| path: src | |
| extensions: .java | |
| show-extensions: false | |
| - name: Create branch, commit changes and open pull request | |
| env: | |
| BRANCH_NAME: update-directory-md-${{ github.run_id }} | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor }}@users.noreply.github.com" | |
| git checkout -b $BRANCH_NAME | |
| git add DIRECTORY.md | |
| git commit -m "chore: update DIRECTORY.md" || echo "No changes to commit" | |
| git push origin $BRANCH_NAME | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ env.BRANCH_NAME }} | |
| title: "Update DIRECTORY.md" | |
| body: | | |
| This pull request updates the `DIRECTORY.md` file automatically. | |
| base: master |