nrwl / nx-set-shas

:sparkles: A Github Action which sets the base and head SHAs required for `nx affected` commands in CI
https://nx.dev
MIT License
161 stars 76 forks source link

Wrong SHAs on `windows-latest` machines #18

Closed Phillip9587 closed 2 years ago

Phillip9587 commented 2 years ago

I run a E2E matrix on Github Actions. The workflow: https://github.com/Phillip9587/nx-stylelint/blob/main/.github/workflows/ci.yml

Example Run with the problem: https://github.com/Phillip9587/nx-stylelint/actions/runs/1757001450

The jobs which run on a windows-latest machine print the following error and set the wrong SHAS:

Run nrwl/nx-set-shas@v2
  with:
    main-branch-name: main
    set-environment-variables-for-job: true
    error-on-no-successful-workflow: false
    last-successful-event: push
Run node $GITHUB_ACTION_PATH/dist/index.js *** main false push 
  node $GITHUB_ACTION_PATH/dist/index.js *** main false push 
  shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.

WARNING: Unable to find a successful workflow run on 'origin/main'
We are therefore defaulting to use HEAD~1 on 'origin/main'

NOTE: You can instead make this a hard error by settting 'error-on-no-successful-workflow' on the action in your workflow.

Run echo "Base SHA"
Base SHA
68f16e8ea90c8cb774235fcb085ce20b6cc28b5b

Head SHA
55ff800f33821008db940385b9c299d3429dda6e

Output from a ubuntu-latest machine:

Run nrwl/nx-set-shas@v2
Run node $GITHUB_ACTION_PATH/dist/index.js *** main false push 

Found the last successful workflow run on 'origin/main'
Commit: 9d26243d7918a14af4214b11b29568fb63c20d64

Run echo "Base SHA"
Base SHA
9d26243d7918a14af4214b11b29568fb63c20d64

Head SHA
55ff800f33821008db940385b9c299d3429dda6e
meeroslav commented 2 years ago

Thank you @Phillip9587, I will look into it as soon as possible.