Jos*_*zet 29 workflow github github-actions
我有一个 GitHub 工作流程,可以为我的 Flutter 应用程序创建 APK。直到最近这一切都很好,我似乎已经耗尽了某种配额。现在,当工作流程运行时,我收到此错误:
Create Artifact Container failed: Artifact storage quota has been hit. Unable to upload any new artifacts
Run Code Online (Sandbox Code Playgroud)
我认为删除所有工件会再次释放空间,因此我使用了另一个工作流程来实现此目的:
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
Run Code Online (Sandbox Code Playgroud)
新的工作流程似乎正在运行,我不再在 GitHub UI 中看到旧文件。但是,在尝试运行 APK 工作流程时我仍然收到错误。有什么想法如何修复这个错误吗?
更新:
ale*_*ras 14
2023 年 5 月。 存储库 -> 设置 -> 操作 -> 常规 -> 工件和日志保留
将天数设置为 1,这将删除旧的自动值并保存。
fre*_*nky 12
没有办法撤消。配额是每月的,因此您只需等待配额重置即可。
Github Actions(运行时)和 Github Storage(工件)应该有单独的配额。
对于 Github Actions,我知道它们对公共存储库是免费的,因此您可以更改存储库的可见性,至少在需要时可以暂时更改。至于 Github Storage,我不确定同样的技巧是否有效,从未测试过。
让我知道,我可以更新答案。
小智 10
我设法通过在部署脚本上添加新步骤来阻止此错误:
- 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,
})
})
Run Code Online (Sandbox Code Playgroud)
将其放在上传步骤的正上方,它将删除存储库以前的所有工件。
| 归档时间: |
|
| 查看次数: |
28017 次 |
| 最近记录: |