Switch to push-protected GH action for typedoc usage
[poolifier.git] / .github / workflows / generate-typedoc.yml
CommitLineData
634be0f3
S
1name: Generate TypeDoc
2
3on:
4 workflow_dispatch:
5
6jobs:
7 generate:
8 runs-on: ubuntu-latest
9
10 steps:
11 - name: Checkout
b8497a0a 12 uses: actions/checkout@v3
634be0f3 13
d32eb966
JB
14 # with:
15 # persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
16 # fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
7e0d447f 17 - name: Set node version to 16
b8497a0a 18 uses: actions/setup-node@v3
634be0f3 19 with:
4f4ae1cb 20 node-version: '16.x'
634be0f3
S
21
22 - name: Generate TypeDoc
23 run: |
24 npm ci
25 npm run typedoc
26
27 - name: Commit files
12257749 28 if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'"
634be0f3
S
29 run: |
30 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
31 git config --local user.name "github-actions[bot]"
32 git commit -m "Generate TypeDoc" -a
33
34 - name: Push changes
12257749 35 if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'"
d32eb966
JB
36 # uses: ad-m/github-push-action@master
37 uses: CasperWA/push-protected@v2
634be0f3 38 with:
d32eb966
JB
39 # github_token: ${{ secrets.GITHUB_TOKEN }}
40 github_token: ${{ secrets.GH_TOKEN_PROTECTED }}
adc9d804 41 branch: ${{ github.event.repository.default_branch }}
d32eb966 42 unprotect_reviews: true