Closed duki994 closed 1 year ago
Thank you for reporting this.
The nx-set-shas
makes no sense when there is only a single commit, but the tool should not break regardless.
It makes sense when there are branch protection rules on main
and dev
branches
Example scenario is:
30 commits for initial dev
branch and dev
deployment
1 commit on main
(README.md)
If nx-set-shas
uses main
branch by default it'll fail.
Makes no sense from usefulness standpoint, but it happens (and can be cumbersome) when you need to push at least empty commit on main
branch which is protected and you also cannot change workflow files on that branch because it's protected.
I'll see to open PR which fixes this issue (PR #85 )
Any updates?
I am also running into this issue. Any update on getting it fixed?
Not related with the described scenario above, but I got the same error when running this action without specifying the fetch-depth 0 parameter in the checkout action:
- uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
Thank you @duki994 for the PR and sorry for waiting so long
Description
nx-set-shas
is not working in scenarios where there is single commit onmain
(or any other) branch.It's not really connected to
main
branch itself, but to any combination ofgit rev-parse ${remoteName}/${branchName}~1
where branch${remoteName}/${branchName}
has single commitSteps to reproduce (one way)
main
(or any other name) branch with single commit (e.gInit with README.md
)development
) with several commits.nx-set-shas
via GH actions to run anyaffected
command on push onmain
branch (e.g after PR merge)Logs
Additional context
nx-set-shas@v3
git rev-parse ${remoteName}/${branchName}~1
doesn't exist but actual${remoteName}/${branchName}
exists