[验证勿合并] 错误来源到 prod #58

Closed
xiaowang wants to merge 8 commits from validation/wrong-source-to-prod into prod
Showing only changes of commit ba843926e0 - Show all commits
+1 -1
View File
@@ -57,7 +57,7 @@ jobs:
response_file="$RUNNER_TEMP/salon-prod-artifacts.json"
curl --fail-with-body --silent --show-error --retry 3 --retry-all-errors \
-H "Authorization: Bearer $GITEA_TOKEN" "$api_base" > "$response_file"
artifact_id=$(node -e 'const fs=require("fs"); const name=process.argv[1]; const data=JSON.parse(fs.readFileSync(process.argv[2],"utf8")); const item=(data.value||[]).find(v=>v.name===name); if(!item||!item.fileContainerResourceUrl) process.exit(2); const m=item.fileContainerResourceUrl.match(/\\/(\\d+)\\/path$/); if(!m) process.exit(3); process.stdout.write(m[1]);' "$ARTIFACT_NAME" "$response_file")
artifact_id=$(node -e 'const fs=require("fs"); const name=process.argv[1]; const data=JSON.parse(fs.readFileSync(process.argv[2],"utf8")); const item=(data.value||[]).find(v=>v.name===name); if(!item||!item.id) process.exit(2); process.stdout.write(String(item.id));' "$ARTIFACT_NAME" "$response_file"
path_url="$GITHUB_SERVER_URL/api/actions_pipeline/_apis/pipelines/workflows/$PREPARE_RUN_ID/artifacts/$artifact_id/path?api-version=6.0-preview"
curl --fail-with-body --silent --show-error --retry 3 --retry-all-errors \
-H "Authorization: Bearer $GITEA_TOKEN" "$path_url" > "$RUNNER_TEMP/salon-prod-artifact-path.json"