rayluo / github-pages-overwriter

A Github Action that overwrites your Github Pages branch with the content of current workdir, thus deploy/publish without polluting your repo history.
MIT License
37 stars 2 forks source link

nodejs error #6

Closed zkkzkk32312 closed 3 months ago

zkkzkk32312 commented 3 months ago

got this error when running the action/workflow

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3

maybe need to use v4?

rayluo commented 3 months ago

Yes, please use v4 and report back. I'll update the README accordingly based on your test result. :)

zkkzkk32312 commented 3 months ago

hey thanks for the quick reply, after using v4, I got an error with exit code 128.

no detail was given.

rayluo commented 3 months ago

after using v4, I got an error with exit code 128.

no detail was given.

That is strange. How did you modify your workflow file? Note that the actions/checkout usage is officially documented here.

zkkzkk32312 commented 3 months ago

im very new to github actions, so its very possible its my own mistake, but here is my current .yml:

name: Deploy Public Folder with GithubPageOverwriter

on: push: branches: ["main"]

workflow_dispatch:

jobs: publish: runs-on: ubuntu-latest steps:

rayluo commented 3 months ago

OK, so you are no longer seeing the initial "Node.js 16 ..." error. Then, your "actions/checkout@v4" change was good.

The "exit code 128" is an irrelevant error. You may try change your "./public" to "public" and retry.

zkkzkk32312 commented 3 months ago

thanks for the info, after modifying the line to : source-directory: public

I am still getting the exit code 128 error.

but using v4 was required to get rid of nodejs error for sure.

rayluo commented 3 months ago

You are hitting this error. Honestly I am not sure where it came from. Can you double check whether you enabled github pages for your project already? That is like a prerequisite. You may refer to the "2. In your Github Pages setting, ..." paragraph in GPO's readme.

zkkzkk32312 commented 3 months ago

@rayluo hey thanks for pointing that out, turns out I need to

Check if "Read and write permissions" are enabled in Settings -> Actions -> General -> Workflow permissions:

rayluo commented 3 months ago

Thanks for sharing. Good to know. Presumably, adding the "permissions" and "contents: ..." lines as below might be able to also get it working WITHOUT checking that "Read and write permissions" setting. It could be a more deterministic pattern to ensure your future projects using GPO smoothly. You may give it a shot. :-)

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out
        # You may use a newer version of https://github.com/actions/checkout
        uses: actions/checkout@v4
        ......