6161 token : ${{ secrets.AUTO_COMMIT_PAT }}
6262
6363 - name : Create update branch
64- run : git switch -c update-doc-${{ inputs.python-version }}
64+ env :
65+ PYTHON_VERSION : ${{ inputs.python-version }}
66+ run : git switch -c "update-doc-${PYTHON_VERSION}"
6567
6668 - name : Download generated doc DBs
6769 uses : actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
7173 merge-multiple : true
7274
7375 - name : Transform JSON
76+ env :
77+ PYTHON_VERSION : ${{ inputs.python-version }}
7478 run : |
7579 # Merge all artifacts
7680 jq -s "add" --sort-keys crates/doc/generated/*.json > crates/doc/generated/merged.json
8387 echo -n '' > $OUTPUT_FILE
8488
8589 echo '// This file was auto-generated by `.github/workflows/update-doc-db.yml`.' >> $OUTPUT_FILE
86- echo "// CPython version: ${{ inputs.python-version } }" >> $OUTPUT_FILE
90+ echo "// CPython version: ${PYTHON_VERSION }" >> $OUTPUT_FILE
8791 echo '// spell-checker: disable' >> $OUTPUT_FILE
8892
8993 echo '' >> $OUTPUT_FILE
@@ -103,15 +107,17 @@ jobs:
103107 - name : Commit, push and create PR
104108 env :
105109 GH_TOKEN : ${{ secrets.AUTO_COMMIT_PAT }}
110+ PYTHON_VERSION : ${{ inputs.python-version }}
111+ BASE_REF : ${{ inputs.base-ref }}
106112 run : |
107113 git config user.name "github-actions[bot]"
108114 git config user.email "github-actions[bot]@users.noreply.github.com"
109115 if [ -n "$(git status --porcelain)" ]; then
110116 git add crates/doc/src/data.inc.rs
111- git commit -m "Update doc DB for CPython ${{ inputs.python-version } }"
117+ git commit -m "Update doc DB for CPython ${PYTHON_VERSION }"
112118 git push -u origin HEAD
113119 gh pr create \
114- --base ${{ inputs.base-ref }} \
115- --title "Update doc DB for CPython ${{ inputs.python-version } }" \
120+ --base "${BASE_REF}" \
121+ --title "Update doc DB for CPython ${PYTHON_VERSION }" \
116122 --body "Auto-generated by update-doc-db workflow."
117123 fi
0 commit comments