name: Generate docs from pod on: push: branches: - main jobs: docs: runs-on: ubuntu-latest permissions: contents: write pull-requests: write steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Check is main protected id: branchCheck run: | RESPONSE=$(curl -s -H "Authorization: Bearer ${{ secrets.token }}" \ "https://api.github.com/repos/${{ github.repository }}/branches/main") PROTECTED=$(echo "${RESPONSE}" | jq -r '.protected') echo "${PROTECTED}" echo "{isProtected}={${PROTECTED}}" >> "${GITHUB_OUTPUT}" - uses: Omochice/action-normalize-vim-plugin-name@4c0461629dd9dfbce8a5e77ef962d8d719ca1885 # v0.1.0 id: normalize with: trim-tail-dot-vim: true - uses: Omochice/action-podeno@5545680f3c7e30f10aa025f2de63bffd90764623 # v0.1.0 with: config: | [ { type: "markdown", in: "README.pod", out: "README.md", }, { type: "vimdoc", in: "README.pod", out: "doc/${{ steps.normalize.outputs.normalizedName }}.txt", }, ] - name: Create auto commit uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 if: ${{ steps.branchCheck.outputs.isProtected != true }} with: commit_message: "docs: update docs" branch: ${{ github.head_ref }} - name: Create Pull Request if: ${{ steps.branchCheck.outputs.isProtected == true }} uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 with: title: "docs: update docs" body: | This PR is created by [create-pull-request](https://github.com/peter-evans/create-pull-request). The docs are generated automatically. author: "GitHub " delete-branch: true