withastro / action

A GitHub Action that deploys your Astro project to GitHub Pages
Other
143 stars 31 forks source link

Cannot build Astro site with Node 20, "actions/checkout@v4" and "withastro/action@v2" #45

Open basher opened 4 months ago

basher commented 4 months ago

I bumped my Astro website Node version to 20 earlier today, but discovered I could no longer build and deploy via Github pages.

There's a related Node 20 bug, which is now closed. And the related PR has been merged.

So... I have just modified my Github pages workflow YML with latest versions: https://github.com/basher/basher-website/blob/master/.github/workflows/static.yml

But... I'm still getting build errors. The error doesn't provide me with any useful info: https://github.com/basher/basher-website/actions/runs/7974519592/job/21770594265#step:3:41

Any ideas??? 🤔

basher commented 4 months ago

I just tried renaming my npm-shrinkwrap.json to package-lock.json and got the same error, so it doesn't appear to be an issue with not being able to find an appropriate lock file.

basher commented 4 months ago

I've managed to get node 18 working again by explicitly adding a node step: https://github.com/basher/basher-website/blob/master/.github/workflows/static.yml#L24

I also reverted the other steps back to their original values.

ARipeAppleByYoursTruly commented 3 months ago

Your workflow file is currently using actions that are not at the latest versions, I think that might be the cause

Can you try bumping versions, comment out your Setup Node step, and see if that solves your problem?

Here are the version bumps you can try:

basher commented 3 months ago

This still fails.

The setup node step allows me to build correctly for the time being.

Capture

ARipeAppleByYoursTruly commented 3 months ago

I think your lock file has to be package-lock.json to work, because I don't see npm-shrinkwrap.json in the conditions used in withastro/action's input validation

Would be nice if withastro/action provided a lock-file input as a fallback to unhandled lock file names