actions-js-build icon indicating copy to clipboard operation
actions-js-build copied to clipboard

"You are currently not on a branch" fatal commit

Open DaanWet opened this issue 3 years ago • 2 comments

So I'm using this workflow setup, the build works perfectly fine, but the commit step fails because I'm currently not on a branch

grunt-build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Compile with Grunt
      uses: elstudio/actions-js-build/build@v2
      with:
        args: 'build'

    - name: Commit changes
      uses: elstudio/actions-js-build/commit@v3
      with:
        commitMessage: Build Latest Version

This is the error I'm getting

Run elstudio/actions-js-build/commit@v3
  with:
    commitMessage: Build Latest Version
    pushBranch: master
    debug: false
/usr/bin/docker run --name bb105e3e0f5633074cb79ea55b1461123c70_d89e67 --label 54bb10 --workdir /github/workspace --rm -e INPUT_COMMITMESSAGE -e INPUT_PUSHBRANCH -e INPUT_WDPATH -e INPUT_DEBUG -e DEBUG -e WD_PATH -e COMMIT_MESSAGE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/gamesense-client/gamesense-client":"/github/workspace" 54bb10:5e3e0f5633074cb79ea55b1461123c70
Checking for uncommitted changes in the git working tree.
1
[detached HEAD bdcbbea] Build Latest Version
 3 files changed, 174 insertions(+), 31 deletions(-)
 rewrite dist/gamesense-client.min.js (98%)
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use

    git push origin HEAD:<name-of-remote-branch>

Is there a way to fix this?

DaanWet avatar Nov 16 '20 08:11 DaanWet

Sorry for that @DaanWet —

Mind giving this a try with the new @v4 versions of these actions?

I believe that should avoid this issue — but I’d love confirmation.

elstudio avatar Feb 27 '21 02:02 elstudio

Tried v4 and it worked 👍

maslick avatar May 23 '21 15:05 maslick