Closed willcoughlin closed 3 years ago
I believe I've figured out what the issue is here. I think it has to do with this line: https://github.com/enriikke/gatsby-gh-pages-action/blob/2156f7ec65e2fa9d8b981a2eee9f5233bfa4995d/index.ts#L40
it seems that what is happening is that when you attempt to run the action without gatsby-args
present then the resulting run will be either npm run build ""
or yarn build ''
depending if you have a package-lock.json
file or not. Either way this results in an empty string being passed to the gatsby build (gatsby build ""
) which the later versions of gatsby doesn't appreciate.
I was unable to solve this with npm
being used instead of yarn
. My solution to this issue was to remove the package-lock.json
file in my repo and run yarn
to create a yarn.lock
file, which I committed. Then in my workflow I added gatsby-args: --verbose
into the with
section of the steps for this action. That resulted in the build command yarn build --verbose
which successfully built my gatsby project.
I'll submit a PR for this soon and maybe the next release will happen at some point, but hopefully my workaround helps in the meantime
I've also run into this issue, after updating gatsby version in package.json
to 2.23.11
. Unsure how far I'll need to drop the version down again to start working, but will post here if I find out. Ideally, of course, this PR would get merged and a new version released, assuming it fixes the issue.
@danwhitston rather than downgrading, another workaround I've seen is to add the --no-color
arg in gatsby-args.
@willcoughlin I tried to use your fork without success. I'm I missing something?
Interesting, and sorry to see that. What's your workflow yaml file look like?
On Mon, Jun 29, 2020, 7:33 AM Roni Hacohen notifications@github.com wrote:
@willcoughlin https://github.com/willcoughlin I tried to use your fork without success. [image: image] https://user-images.githubusercontent.com/3350618/86005829-cc24c080-ba1d-11ea-9931-db2b44cad9cf.png I'm I missing something?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/enriikke/gatsby-gh-pages-action/issues/29#issuecomment-651088120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHDNPBOMCVIBCZOBWMT3QLRZCCZPANCNFSM4NRCGLSQ .
- name: Gatsby Publish
uses: willcoughlin/gatsby-gh-pages-action@v2.1.1
with:
# A personal access token needed to push your site after it has been built.
access-token: XXXX
It's the tag. It should work if you change @v2.1.1 to @TestTag. Pardon the name, I didn't intend for its public use 😉.
On Mon, Jun 29, 2020, 11:20 PM Roni Hacohen notifications@github.com wrote:
- name: Gatsby Publish uses: willcoughlin/gatsby-gh-pages-action@v2.1.1 with: # A personal access token needed to push your site after it has been built. access-token: XXXX
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/enriikke/gatsby-gh-pages-action/issues/29#issuecomment-651522442, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHDNPDOC2NLNQYHTY6WIM3RZFR2VANCNFSM4NRCGLSQ .
Actually, the latest version of this action (tag v2) has already solved this issue that exists in version 2.1.1.
Just do - uses: enriikke/gatsby-gh-pages-action@v2
Yup, fixed this by using @v2 instead of 2.1.1.
I am running a simple workflow with v2.1.1 which appears to fail when at
npm run build
. It looks like something is causing a pair of quotes to be inserted as an arg when it callsgatsby build
. Any idea what could be causing this? I don't think this comes from my configuration.Here's the relevant output, picking up at the end of the
npm install
step:In my package.json, build is defined as
gatsby build
:Finally, here's my workflow file:
Any more helpful info, I can gladly provide!