Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to execute the Nx set sha action #115

Closed
mauriziovitale opened this issue Sep 7, 2023 · 8 comments · Fixed by #116
Closed

Not able to execute the Nx set sha action #115

mauriziovitale opened this issue Sep 7, 2023 · 8 comments · Fixed by #116
Assignees
Labels
bug Something isn't working

Comments

@mauriziovitale
Copy link

Since this morning we are getting the following error:

Run nrwl/nx-set-shas@v3
Run node "$GITHUB_ACTION_PATH/dist/index.js" "$gh_token" "$main_branch_name" "$error_on_no_successful_workflow" "$last_successful_event" "$working_directory" "$working_id"
/home/runner/work/_actions/nrwl/nx-set-shas/v3/dist/index.js:2140
static {
^

SyntaxError: Unexpected token '{'
at wrapSafe (internal/modules/cjs/loader.js:1029:16)
at Module._compile (internal/modules/cjs/loader.js:1078:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Error: Process completed with exit code 1.

I have the feeling a recent patch is causing the issue, most probably
0712662

@meeroslav

@mlitvinav
Copy link

mlitvinav commented Sep 7, 2023

Seems something is broken in the latest patch version v3.0.1. Downgrading to the previous working version v3.0.0 fixes the previously mentioned problem.

Here is my action usage if you look for a quick fix:

      - name: detect affected
        uses: nrwl/[email protected]

@mauriziovitale
Copy link
Author

I think the last patch is forcing to use node 18
https://github.com/nrwl/nx-set-shas/releases/tag/v3

I was already using an "old" version but now is not working, and I guess because we are not using node 18 yet

dmfalke added a commit to VEuPathDB/web-monorepo that referenced this issue Sep 7, 2023
Use older version of nrwl/nx-set-shas (due to nrwl/nx-set-shas#115)
@mauriziovitale
Copy link
Author

mauriziovitale commented Sep 7, 2023

Lesson learned ... never use tag version for gh action but always pin sha :)

8b116da

works as expected

@meeroslav
Copy link
Collaborator

meeroslav commented Sep 8, 2023

The issue is in the Octokit version 6. I will downgrade to v5.
The node setting in the repo does not force you to use newer version of Node, but there seems to be some problematic code in v6, which is not present in v5.

Previously we used v3 of Octokit which is very outdated and does not support newer versions of Node.

Node 18 is now LTS and Node 16 will be unsupported in a few days, so there is no point in using anything below v18 at the moment.

@meeroslav
Copy link
Collaborator

@mauriziovitale, which node version are you using?

@meeroslav meeroslav self-assigned this Sep 8, 2023
@meeroslav meeroslav added the bug Something isn't working label Sep 8, 2023
@mauriziovitale
Copy link
Author

mauriziovitale commented Sep 8, 2023

@meeroslav node-version: 14.15.4
I know that is a very old one and the 18 is LST we have an issue and it is part of the roadmap :)

@hylle
Copy link

hylle commented Sep 8, 2023

Node 18 is now LTS and Node 16 will be unsupported in a few days, so there is no point in using anything below v18 at the moment.

@meeroslav Either way an upgrade requiring a higher new node version should probably be a major bump to the action.

@mauriziovitale
Copy link
Author

I agree with @hylle if your are following semantic version u should bump and u should not change the version already deployed with a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants