1- name : Build Percona Operator for PostgreSQL docs
1+ name : Build Percona Operator for MySQL docs
22on :
33 push :
44 branches :
@@ -22,25 +22,13 @@ jobs:
2222 uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
2323 with :
2424 python-version : ' 3.x'
25-
26- # Configure git
27- - name : Configure git
28- env :
29- ROBOT_TOKEN : ${{ secrets.ROBOT_TOKEN }}
30- run : |
31- git config --global url."https://percona-platform-robot:${ROBOT_TOKEN}@github.com".insteadOf "https://github.com"
32- git config user.name "GitHub Action"
33- git config user.email "github-action@users.noreply.github.com"
34- git config user.password "${ROBOT_TOKEN}"
35- echo "GIT_USER=percona-platform-robot:${ROBOT_TOKEN}" >> $GITHUB_ENV
36-
3725
3826 # Extract release from YAML
3927 - name : Extract release from variables
4028 run : |
41- RELEASE=$(grep '^release:' variables.yml | awk '{print $2}' )
29+ RELEASE=$(grep '^release:' variables.yml | awk '{print $2}' | tr -d "'" )
4230 echo "RELEASE=$RELEASE" >> $GITHUB_ENV
43- # PRUNED_VERSION=$(grep '^pruned_version:' variables.yml | awk '{print $2}' )
31+ # PRUNED_VERSION=$(grep '^pruned_version:' variables.yml | awk '{print $2}' | tr -d "'" )
4432# echo "PRUNED_VERSION"=$"PRUNED_VERSION" >> $GITHUB_ENV
4533
4634
5139 pip install wheel
5240 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
5341
54-
42+ # Configure git auth right before it's needed, scoped to this checkout only,
43+ # so the credential isn't live on disk for the earlier setup steps.
44+ - name : Configure git
45+ env :
46+ ROBOT_TOKEN : ${{ secrets.ROBOT_TOKEN }}
47+ run : |
48+ git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(printf '%s' "x-access-token:${ROBOT_TOKEN}" | base64 -w0)"
49+ git config user.name "GitHub Action"
50+ git config user.email "github-action@users.noreply.github.com"
51+
5552 # Deploy docs
5653 - name : Deploy docs
5754 env :
6057 mike deploy $RELEASE -u latest -b publish -p
6158 mike set-default latest -b publish -p
6259# mike delete $PRUNED_VERSION -b publish -p
60+
61+ # Drop the credential as soon as it's no longer needed
62+ - name : Clear git credentials
63+ if : always()
64+ run : git config --local --unset-all http.https://github.com/.extraheader || true
6365
0 commit comments