Skip to content

Commit 47b8d1d

Browse files
authored
Doc upload token fix (pytorch#17078)
### Summary Unblock the doc upload job by using an explicit access token secret. I verified this works in pytorch#16989.
1 parent 4f3f329 commit 47b8d1d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/doc-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ jobs:
101101
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
102102
secrets: inherit
103103
with:
104+
secrets-env: DOC_BUILD_GITHUB_TOKEN
104105
repository: pytorch/executorch
105106
download-artifact: docs
106107
ref: gh-pages
107108
timeout: 90
108-
secrets-env: GITHUB_TOKEN
109109
script: |
110110
set -euo pipefail
111111
@@ -116,8 +116,6 @@ jobs:
116116
117117
# Fail immediately instead of prompting for input.
118118
export GIT_TERMINAL_PROMPT=0
119-
# Configure git to use the token for authentication
120-
git remote set-url origin https://x-access-token:${SECRET_GITHUB_TOKEN}@github.com/pytorch/executorch.git
121119
122120
# Convert refs/tags/v1.12.0rc3 into 1.12.
123121
# Adopted from https://github.com/pytorch/pytorch/blob/main/.github/workflows/_docs.yml#L150C11-L155C13
@@ -137,6 +135,9 @@ jobs:
137135
mv "${RUNNER_ARTIFACT_DIR}"/html/* "${TARGET_FOLDER}"
138136
git add "${TARGET_FOLDER}" || true
139137
138+
echo "::add-mask::$SECRET_DOC_BUILD_GITHUB_TOKEN" # Mask the secret in GH logs
139+
git remote set-url origin https://x-access-token:$SECRET_DOC_BUILD_GITHUB_TOKEN@github.com/pytorch/executorch.git
140+
140141
git config user.name 'pytorchbot'
141142
git config user.email 'soumith+bot@pytorch.org'
142143
git commit -m "Auto-generating sphinx docs" || true

0 commit comments

Comments
 (0)