Closed muzimuzhi closed 10 months ago
Hi @muzimuzhi, thanks for bringing this to my attention.
I've prepared a pull request (#17) that introduces support for actions/upload-artifact@v4
by utilizing the GitHub REST API; as a result of this change is the requirement of a PAT with read and write access when running the action.
Thanks! I confirm with https://github.com/GeekyEggo/delete-artifact/pull/17 now GeekyEggo/delete-artifact@main
works as expected. 🎉
Looking forward to a v4.0.0 release.
BTW then two example.yml
may be needed, one for v2 and one for v4.
geekyeggo/delete-artifact@v4
has been tagged and released, and the examples have been updated. 🎉
If you experience any problems, please let me know. Happy holidays.
I have just upgraded our upload/download actions from @v3 to @v4 - and also tried updating this action to @v4 Out of the box, we are getting this error:
Exactly the same setup with all actions@v3 worked. One thing though - the actions/upload-artifact@v4
and geekyeggo/delete-artifact@v4
are in two different subsequent jobs.
I have tried:
geekyeggo/delete-artifact@4.1.0
geekyeggo/delete-artifact@4
token
parametertoken: ${{ github.token }}
(no extra PAT created, this should use the default github token)token: ${{ secrets.GITHUB_TOKEN }}
(no extra PAT created, this should use the default github token)I have then tried deleting the artifact inside the same job in a subsequent step instead of in the next job. This worked.
This is the upload-step in one job:
And this is the delete-step in a subsequent job:
I have checked that the name
is exactly the same in the upload and delete step.
I'd greatly appreciate any ideas to what I'm doing wrong.
@rolfboom Seems like related to workflow permissions, see a similar post https://github.com/orgs/community/discussions/60820.
BTW, better to raise a new issue.
For me the solution was to add actions: write
deploy:
name: "Deploy"
runs-on: ubuntu-20.04
permissions:
actions: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# delete-artifact
- name: Clean
uses: geekyeggo/delete-artifact@v4
with:
name: github-pages
An example workflow: https://github.com/muzimuzhi/hello-github-actions/actions/runs/7256001370
More comparisons can be found in https://github.com/muzimuzhi/hello-github-actions/pull/24. It seems changes more than a naive package upgrading are needed (I'm not a front-end developer). Also the
listArtifacts()
function from@actions/artifact
might be helpful.Several breaking changes were introduced in
actions/upload-artifact@v4
, see@actions/artifact
https://github.com/actions/toolkit/tree/main/packages/artifact