I’m trying the Lab Course Hello, GitHub Actions!, but I’m stuck at the second step when I should Add an entrypoint script. I’ve created the file entrypoint.sh using the Web UI, then cloned the Git repository as suggested in the PR https://github.com/thinkh/hello-github-actions/pull/2. However, I’m stuck when I should make the script executable. How does this work on Windows? Is there a way to bypass this check?
Hi @thinkh! I believe that the step is necessary - the file’s correct permissions are required for GitHub Actions to execute the script.
This is absolutely possible on Windows! It depends a bit on which terminal or shell you’re using. If you’re using Git Bash from git-scm.com, the commands would be identical to the ones listed in the course.
Which terminal are you using locally?
Hi @brianamarie! Thanks for your reply. I’ve tried multiple terminals (Powershell, Git Bash, Ubuntu WSL). You are right that I can run the command on the Git Bash. Afterwards, however, there is no change I can commit, as the following console log shows:
user@LAPTOP MINGW64 /d/w/hello-github-actions (first-action) $ chmod +x action-a/entrypoint.sh user@LAPTOP MINGW64 /d/w/hello-github-actions (first-action) $ git status On branch first-action Your branch is up to date with 'origin/first-action'. nothing to commit, working tree clean user@LAPTOP MINGW64 /d/w/hello-github-actions (first-action) $
The same applies to the Ubuntu WSL. Powershell does not support the command and throws an exception.
My assumption is that the underlying disk format (NTFS) does not support that file permission. Do you have any other idea what I could try?
Hmm, that’s interesting @thinkh. Let’s check to see if the file does in fact have the correct permissions. I’m not sure why that wouldn’t be something to commit. To check if the file is executable, run
ls -al. The output should have something like
-rwxr-xr-x listed before it.
Have you pushed the changes you do have? If so, is the course reacting as expected?
The first time I checked out the repo using Git Extensions and followed the steps as I explained on different terminals. That didn’t work as I described before.
To verify what I did, I’ve tried all steps (checkout, chmod, commit and push) inside the Ubuntu WSL and this time it worked. You can see my last commit and the bot message in my PR. So it seems to be different when you checkout the repository in Windows rather than a Linux system.
user@LAPTOP:/d/w$ git clone https://github.com/thinkh/hello-github-actions.git hello2 Cloning into 'hello2'... remote: Enumerating objects: 25, done. remote: Counting objects: 100% (25/25), done. remote: Compressing objects: 100% (21/21), done. remote: Total 25 (delta 3), reused 19 (delta 2), pack-reused 0 Unpacking objects: 100% (25/25), done. user@LAPTOP:/d/w$ cd hello2 user@LAPTOP:/d/w/hello2$ git checkout first-action Branch 'first-action' set up to track remote branch 'first-action' from 'origin'. Switched to a new branch 'first-action' user@LAPTOP:/d/w/hello2$ chmod +x action-a/entrypoint.sh user@LAPTOP:/d/w/hello2$ git add action-a/entrypoint.sh user@LAPTOP:/d/w/hello2$ git status On branch first-action Your branch is up to date with 'origin/first-action'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: action-a/entrypoint.sh user@LAPTOP:/d/w/hello2$ git commit -m "make entrypoint script executable" [first-action 8d8dfea] make entrypoint script executable 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 action-a/entrypoint.sh user@LAPTOP:/d/w/hello2$
To verify the steps I also tried all the steps using the Git Bash, but again there was nothing to commit afterwards.
user@LAPTOP MINGW64 /d/w $ git clone https://github.com/thinkh/hello-github-actions.git -b permission-on-git-bash hello3 Cloning into 'hello3'... remote: Enumerating objects: 28, done. remote: Counting objects: 100% (28/28), done. remote: Compressing objects: 100% (24/24), done. remote: Total 28 (delta 3), reused 22 (delta 2), pack-reused 0 Unpacking objects: 100% (28/28), done. user@LAPTOP MINGW64 /d/w $ cd hello3 user@LAPTOP MINGW64 /d/w/hello3 (permission-on-git-bash) $ chmod +x action-a/entrypoint.sh user@LAPTOP MINGW64 /d/w/hello3 (permission-on-git-bash) $ git add action-a/entrypoint.sh user@LAPTOP MINGW64 /d/w/hello3 (permission-on-git-bash) $ git commit -m "make entrypoint script executable" On branch permission-on-git-bash nothing to commit, working tree clean user@LAPTOP MINGW64 /d/w/hello3 (permission-on-git-bash) $
I wrote a long reply before that was removed by one of the moderators… I won’t write everything again. Just in short: I found a solution that worked! You can restore the post if anyone is interested…
Thanks for your help.
Thanks for reaching out and for being here! I’ve looked for the message that you’ve mentioned was removed on our spam quarantine and can’t find it, I apologize for the inconvenience.
I also got this problem. It’d help me a lot if you can restore the solution or tell me how to do it.
Hi @seniru! I was able to restore the post, so you can see the solution above. Let me know if you need more help beyond those instructions.
Thank you again @thinkh for posting them!
P.S. I’m sorry @andreagriffiths11 for not posting here - I was able to find the message and restore it.
@brianamarieThanks for restoring my post. Is there a way to change the solution to my restored post? Or could you do it as moderator?
Possibly a simpler solution for Windows users who don’t want to or can’t install things is to use https://repl.it/languages/bash - follow the steps as in the tutorial, except before git pushing it will prompt you to set your user email/name:
git config --global user.email "email@example.com" git config --global user.name "Your Name"
You will also need to enter your github username and password after the push command.
I’m struggling with the same issue.
However, am I the only one who doesn’t actually think this is a solution?
Just use a Linux VM instead of Windows shouldn’t be an acceptable answer.
@gertjanmonkeyproof I agree - I have notified the course author and they are working on a better solution.
Try the following command
git update-index --chmod=+x action-a/entrypoint.sh
that worked for me.
If you follow the instructions as in the tutorial, but use the bash console at https://repl.it/languages/bash it works. You will be prompted for another couple of steps (eg author name/email, credentials for github), but that’s fairly self explanatory.
If I understand you correctly, don’t use git bash but use WSL, right?
The command from @techwatching worked for me in Git Bash.