1414jobs :
1515 build :
1616 runs-on : ubuntu-latest
17+ permissions :
18+ contents : write
1719 steps :
1820 - name : Checkout code
19- uses : actions/checkout@v4
21+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2022
2123 - name : Set up Python
22- uses : actions/setup-python@v5
24+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2325 with :
2426 python-version : 3.x
2527
26- - uses : actions/cache@v4
28+ - uses : actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
2729 with :
2830 path : ~/.cache/pip
2931 key : ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }}
@@ -44,21 +46,25 @@ jobs:
4446 - name : Resolve url path
4547 id : resolve_url_path
4648 shell : bash
49+ env :
50+ CUSTOM_PATH : ${{ github.event.inputs.custom-path }}
51+ GITHUB_REF_NAME : ${{ github.ref_name }}
52+ GITHUB_RELEASE_TAG_NAME : ${{ github.event.release.tag_name }}
4753 run : |
48- if [[ -n "${{ github.event.inputs.custom-path } }" ]]; then
49- echo "path=${{ github.event.inputs.custom-path } }" >> $GITHUB_OUTPUT
54+ if [[ -n "${CUSTOM_PATH }" ]]; then
55+ echo "path=${CUSTOM_PATH }" >> $GITHUB_OUTPUT
5056 # 0.x releases deploy to 0.x path, all other releases deploy to latest path
51- elif [[ "${{ github.event_name }}" == "release" && "${{ github.event.release.tag_name } }" == 0.* ]]; then
57+ elif [[ "${{ github.event_name }}" == "release" && "${GITHUB_RELEASE_TAG_NAME }" == 0.* ]]; then
5258 echo "path=0.x" >> $GITHUB_OUTPUT
5359 # for manual builds deploy to the branch name path
5460 elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
55- echo "path=${{ github.ref_name } }" >> $GITHUB_OUTPUT
61+ echo "path=${GITHUB_REF_NAME }" >> $GITHUB_OUTPUT
5662 else
5763 echo "path=latest" >> $GITHUB_OUTPUT
5864 fi
5965
6066 - name : Deploy to GitHub Pages
61- uses : peaceiris/actions-gh-pages@v4
67+ uses : peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
6268 with :
6369 github_token : ${{ secrets.GITHUB_TOKEN }}
6470 publish_dir : ./docs_compiled
0 commit comments