简体   繁体   English

在操作和包上重新生成过期的 GitHub PAT

[英]Regenerate expired GitHub PAT on Actions and Packages

I am using GitHub Actions & Packages from Beta.我正在使用来自 Beta 的 GitHub 操作和包。 Yesterday, the PAT expired.昨天,PAT 到期了。 That's why my GitHub Actions failed.这就是我的 GitHub 操作失败的原因。 There is a Regenerate button on Profile > Developer Settings > Personal Access Token . Profile > Developer Settings > Personal Access Token上有一个 Regenerate 按钮。 I clicked it and created a new PAT.我单击它并创建了一个新的 PAT。

At this step, I am able to login docker.pkg.github.com and push the image to GitHub Registry.在这一步,我可以login docker.pkg.github.com并将图像推送到 ZD3B7C913CD04EBFECZ0.9C913CD04EBFECZ Registry

But, I am getting an error message when I pull that image.但是,当我拉出该图像时,我收到一条错误消息。

This is the error message:这是错误消息:

Error response from daemon: unauthorized: Your request could not be authenticated
by the GitHub Packages service.  Please ensure your access token is valid and has
the appropriate scopes configured.

How can I solve this expired PAT issue?如何解决这个 PAT 过期问题?

This was a bug and reported on the GitHub community https://github.community/t/bug-report-personal-access-tokens/147968/2这是一个错误并在 GitHub 社区https://github.community/t/bug-report-personal-access-tokens/147968/2上报告

The shell stores your old token and doesn't update it. shell存储您的旧令牌并且不更新它。 That's why you have to logout first for one time.这就是为什么您必须先logout一次。

The solution:解决方案:

  1. Regenerate or Create a new Personal Access Token重新生成或创建新的个人访问令牌
  2. Update your repo's Secret更新你的 repo 的 Secret
  3. in a shell , docker logout https://docker.pkg.github.com in a shell , docker logout https://docker.pkg.github.com
  4. in a shell , docker login https://docker.pkg.github.com -u GITHUBUSERNAME in a shell , docker login https://docker.pkg.github.com -u GITHUBUSERNAME
  5. use the new token as the password使用新令牌作为密码

Then you will able to pull an image from the GitHub registry as always.然后,您将能够像往常一样从 GitHub 注册表中提取图像。

I got the answer from zsoobhan-tc's post.我从 zsoobhan-tc 的帖子中得到了答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM