actions / deploy-pages

GitHub Action to publish artifacts to GitHub Pages for deployments
https://pages.github.com
MIT License
667 stars 79 forks source link

The user 'System:PublicAccess;aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource. Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException #381

Open EvanCarroll opened 2 weeks ago

EvanCarroll commented 2 weeks ago

When in run download-artifacts with debug mode enabled I see

##[debug]Evaluating condition for step: 'Download artifacts'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Download artifacts
##[debug]Loading inputs
##[debug]Evaluating: github.repository
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'repository'
##[debug]=> 'webpros-cpanel/wp[2](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:2)-openapi'
##[debug]Result: 'webpros-cpanel/wp2-openapi'
##[debug]Evaluating: github.run_id
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'run_id'
##[debug]=> '11747409275'
##[debug]Result: '11747409275'
##[debug]Loading env
Run actions/download-artifact@v4
/usr/bin/docker exec  f48b7a06150[3](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:3)5644e83730646e5925d32bd54511a303205d1766a9638bc7b530 sh -c "cat /etc/*release | grep ^ID"
##[debug]ID=alpine
##[debug]Container distribution is alpine. Running JavaScript Action with external tool: node20_alpine
##[debug]Resolved path is /__w/wp2-openapi/wp2-openapi
Downloading single artifact
##[debug]Workflow Run Backend ID: 7[4](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:4)51bd47-bf1b-4e92-a[5](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:5)d7-cac5e28f0e36
##[debug]Workflow Job Run Backend ID: ca395085-040a-52[6](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:6)b-2ce8-bdc85f692774
##[debug][Request] ListArtifacts https://results-receiver.actions.githubusercontent.com/twirp/github.actions.results.api.v1.ArtifactService/ListArtifacts
##[debug][Response] - 200
##[debug]Headers: {
##[debug]  "content-length": "491",
##[debug]  "content-type": "application/json",
##[debug]  "date": "Fri, 08 Nov 2024 18:20:29 GMT",
##[debug]  "x-github-backend": "Kubernetes",
##[debug]  "x-github-request-id": "8A04:1859:1EE220:26FF28:6[7](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:7)2E566D"
##[debug]}
##[debug]Body: {
##[debug]  "artifacts": [
##[debug]    {
##[debug]      "workflow_run_backend_id": "d[8](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:8)2481f5-dddc-4f82-96ef-3561209f2765",
##[debug]      "workflow_job_run_backend_id": "ca3[9](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:9)5085-040a-526b-2ce8-bdc85f692774",
##[debug]      "database_id": "2164529299",
##[debug]      "name": "github-pages",
##[debug]      "size": "3420966",
##[debug]      "created_at": "2024-[11](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:11)-08T18:19:00Z"
##[debug]    },
##[debug]    {
##[debug]      "workflow_run_backend_id": "7451bd47-bf1b-4e92-a5d7-cac5e28f0e36",
##[debug]      "workflow_job_run_backend_id": "ca395085-040a-526b-2ce8-bdc85f692774",
##[debug]      "database_id": "2164534872",
##[debug]      "name": "github-pages",
##[debug]      "size": "3421888",
##[debug]      "created_at": "2024-11-08T18:20:28Z"
##[debug]    }
##[debug]  ]
##[debug]}
##[debug]More than one artifact found for a single name, returning newest (id: 2164534872)
##[debug]Found named artifact 'github-pages' (ID: 2164534872, Size: 3421888)
Preparing to download the following artifacts:
- github-pages (ID: 2164534872, Size: 3421888)
##[debug]Artifact destination folder already exists: /__w/wp2-openapi/wp2-openapi
##[debug]Workflow Run Backend ID: 7451bd47-bf1b-4e92-a5d7-cac5e28f0e36
##[debug]Workflow Job Run Backend ID: ca395085-040a-526b-2ce8-bdc85f692774
##[debug][Request] ListArtifacts https://results-receiver.actions.githubusercontent.com/twirp/github.actions.results.api.v1.ArtifactService/ListArtifacts
##[debug][Response] - 200
##[debug]Headers: {
##[debug]  "content-length": "253",
##[debug]  "content-type": "application/json",
##[debug]  "date": "Fri, 08 Nov 2024 18:20:29 GMT",
##[debug]  "x-github-backend": "Kubernetes",
##[debug]  "x-github-request-id": "8A04:1859:1EE24A:26FF69:672E566D"
##[debug]}
##[debug]Body: {
##[debug]  "artifacts": [
##[debug]    {
##[debug]      "workflow_run_backend_id": "7451bd47-bf1b-4e92-a5d7-cac5e28f0e36",
##[debug]      "workflow_job_run_backend_id": "ca395085-040a-526b-2ce8-bdc85f692774",
##[debug]      "database_id": "2164534872",
##[debug]      "name": "github-pages",
##[debug]      "size": "3421888",
##[debug]      "created_at": "2024-11-08T18:20:28Z"
##[debug]    }
##[debug]  ]
##[debug]}
##[debug][Request] GetSignedArtifactURL https://results-receiver.actions.githubusercontent.com/twirp/github.actions.results.api.v1.ArtifactService/GetSignedArtifactURL
##[debug][Response] - 200
##[debug]Headers: {
##[debug]  "content-length": "562",
##[debug]  "content-type": "application/json",
##[debug]  "date": "Fri, 08 Nov 2024 18:20:29 GMT",
##[debug]  "x-github-backend": "Kubernetes",
##[debug]  "x-github-request-id": "8A04:1859:1EE26B:26FF91:672E566D"
##[debug]}
##[debug]Body: {
##[debug]  "signed_url": "redacted"
##[debug]}
Redirecting to blob download url: https://productionresultssa12.blob.core.windows.net/actions-results/7451bd47-bf1b-4e92-a5d7-cac5e28f0e36/workflow-job-run-ca395085-040a-526b-2ce8-bdc85f692774/artifacts/afa28766d3caf497f6ad369ac6c5505dd8db6689a300a79784c20dcaaf97018f.zip
Starting download of artifact to: /__w/wp2-openapi/wp2-openapi
(node:[17](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:5:17)9) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Artifact download completed successfully.
Total of 1 artifact(s) downloaded
Download artifact has finished successfully
##[debug]Node Action run completed with exit code 0
##[debug]Set output download-path = /__w/wp2-openapi/wp2-openapi
##[debug]Finishing: Download artifacts

But when I use deploy-pages@v3, I get


##[debug]Evaluating condition for step: 'Deploy to GitHub Pages'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Deploy to GitHub Pages
##[debug]Loading inputs
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run actions/deploy-pages@v3
/usr/bin/docker exec  f48b7a0615035644e83730646e59[2](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:6:2)5d32bd54511a303205d1766a9638bc7b5[3](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:6:3)0 sh -c "cat /etc/*release | grep ^ID"
##[debug]ID=alpine
##[debug]Container distribution is alpine. Running JavaScript Action with external tool: node20_alpine
##[debug]all variables are set
##[debug]all variables are set
##[debug]ID token url is **REDACTED**
::add-mask::***
##[debug]Actor: evan-carroll_webpros
##[debug]Action ID: __actions_deploy-pages
##[debug]Actions Workflow Run ID: 11[7](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:6:7)47409275
##[debug]all variables are set
Artifact exchange URL: https://pipelinesghubeus12.actions.githubusercontent.com/R95hMgV6VWx6zHHzX45BWQVdkm77HLHxaUGQYlOxbNJrnrNnNj/_apis/pipelines/workflows/11747409275/artifacts?api-version=6.0-preview
##[debug]{"count":0,"value":[]}
Error: Error: No uploaded artifact was found! Please check if there are any errors at build step, or uploaded artifact name is correct.
    at getSignedArtifactMetadata (/__w/_actions/actions/deploy-pages/v3/src/internal/api-client.js:94:1)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Deployment.create (/__w/_actions/actions/deploy-pages/v3/src/internal/deployment.js:6[8](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11747409275/job/32729335831#step:6:8):1)
    at main (/__w/_actions/actions/deploy-pages/v3/src/index.js:30:1)
Error: Error: No uploaded artifact was found! Please check if there are any errors at build step, or uploaded artifact name is correct.
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Deploy to GitHub Pages

The pipelinesghubeus12.actions.githubusercontent.com returns an error that says,

{"$id":"1","innerException":null,"message":"The user 'System:PublicAccess;aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}

What is the solution to this error? And why does it only show when deploy-pages@v3 tries to obtain an artifacts and not download-artifact@v4?

yoannchaudet commented 4 days ago

I believe this is part of Actions' artifacts v3 being deprecated. We should have some changelog post on that specifically for Pages shortly.