![](/img/trans.png)
[英]When deploying to Azure app service from GitHub I get "Artifact storage quota has been hit." error. How to I fix this?
[英][GitHub Actions]: Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
我有一个 GitHub 工作流程,可以为我的 Flutter 应用程序创建 APK。 直到最近这一切都很好,我似乎已经用完了某种配额。 现在,当工作流运行时,出现此错误:
Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
我假设删除所有工件会再次释放空间,所以我使用另一个工作流程来实现这一点:
name: 'Delete old artifacts'
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
delete-artifacts:
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 0days
新的工作流程似乎正在运行,我不再在 GitHub UI 中看到旧文件。 但是,我在尝试运行 APK 工作流程时仍然遇到错误。 任何想法如何解决这个错误?
更新:
没有办法撤消。 配额是每月的,所以你只需要等待配额重置。
Github Actions (runner time) 和 Github Storage (artifacts) 应该有单独的配额。
对于 Github 操作,我知道它们对公共存储库是免费的,因此您可以更改存储库的可见性,至少在需要时可以暂时更改。 至于 Github 存储,我不确定同样的技巧是否有效,从未测试过。
让我知道,我可以更新答案。
我设法通过在我的部署脚本中添加一个新步骤来阻止此错误:
- name: Delete Old Artifacts
uses: actions/github-script@v6
id: artifact
with:
script: |
const res = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
})
res.data.artifacts
.forEach(({ id }) => {
github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: id,
})
})
将它放在上传步骤的正上方,它将删除存储库中所有以前的工件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.