kbss-cvut/s-forms

Publish-npm-beta github action fails from fork and dependabot PR

Closed this issue · 5 comments

PRs created from a fork or dependabot are causing failure in GH action publish-npm-beta step.

  1. PR created from fork #288 resulted in GH action failure https://github.com/kbss-cvut/s-forms/actions/runs/8362521150:
Run phips28/gh-action-bump-version@master.
...
...
runInWorkspace | command: git args: [ 'checkout', 'fix/imports' ]
✖  fatal     error: pathspec 'fix/imports' did not match any file(s) known to git

git exited with code 1
✖  fatal     Failed to bump version
  1. Same failure occurred due to dependabot PR #290, which resulted in GH action
    https://github.com/kbss-cvut/s-forms/actions/runs/8386115851/job/22965992150 containing failure:
Run phips28/gh-action-bump-version@master.
...
...
runInWorkspace | command: git args: [ 'checkout', 'dependabot/npm_and_yarn/webpack-dev-middleware-6.1.2' ]
✖  fatal     error: pathspec 'dependabot/npm_and_yarn/webpack-dev-middleware-6.1.2' did not match any file(s) known to git

git exited with code 1
✖  fatal     Failed to bump version

Moreover, note we have some deprecations in build which most-likely does not cause the issue, but worth mention it here / can be solved as part of solution.
See https://github.com/kbss-cvut/s-forms/actions/runs/8362521150
image

Re-opening as it needs to be tested.

I checked all GH actions and i can confirm that workflow Publish NPM Beta Package never worked from fork.

I am reopening and reverting commits, except for deprecation notes (0283499) as none of the fixes worked.
We might have to change the workflow in the future. The issue comes from - uses: "phips28/gh-action-bump-version@master" in npm-publish-beta.yml. It is trying to checkout a unknown branch (from fork or from dependabot), and fails to do so.

I would try to run the following:

  • git branch -a there to see if it is really the case that the branch does not exist (even try both pull_request and pull_request_target)
  • if the branch exists, I would try to do the workflow manually (i.e., do the same as you would do in the console on localhost)

Consider trying it on two new forks instead of in s-forms repo as it is easy to do (no need to set up secret or something like that for problematic steps)