GitHub Actions & Tutorial On Automated Testing - Issue with commiting changes to remote repository

Dear Codecademy Community and fellow GitHub users!

As I am fairly new to GitHub and am on the verge of finishing the Git&GitHub course, I faced an issue when trying to follow the tutorial GitHub Actions & Tutorial On Automated Testing. There, I had some issues on commiting the changes and pushing the branch to my remote repository. Most notably, I am not sure where (i.e. in which directory - add-automated-tests-off-platform-project, .github or workflows) I should execute the following commands:

git add . 
git commit -a -m “added a GitHub action to run unit tests automatically on code push”
git push --set-upstream “add-auto-tests”

The steps before that, i.e. cloning the remote repository to my GitBash terminal, creating the .github/workflows/unittests.yam1 file worked well. When I try to execute the aforementioned code, however, I get the following error messages:

This happens when I execute the code from ~/add-automated-tests-off-platform-project/, ~/add-automated-tests-off-platform-project/.github/ or ~/add-automated-tests-off-platform-project/.github/workflows

These hinder the branch add-auto-tests from being pushed to my remote repository on GitHub.
Therefore, I kindly wanted to ask you what I missed or where my fault-of-thought here is. In case that this code needs to be executed in a specific directory, it would perhaps be of help to specify which one it is in the tutorial.

I’d like to greatly thank you in advance and am sending kind greetings for the day/evening!
Magda

I think the actual problem is just a copy/paste issue where the quotes characters copied are different to the plain double quote.

compared with "

Use a plain " double quote (do not copy/paste, just type the character and you’ll probably see the difference even in gitbash).

Hi! when I want to push my code I get an error.
image

Is the problem that I cloned with Http? instead of ssh? I have a problem getting a ssh key to my account.

I’m afraid I don’t know, I’d hazard a guess the tracking is set up incorrectly for some reason (see git remote -v for the current remotely tracked repos). It’s possible there’s an access issue but it’s hard to say (I’m assuming you’ve successfully worked with other repos beforehand). Check the address you’re using to track matches up with your hosted repo, it it’s all good then yes, you might have to look into access issues.

I solved the problem by updating the scopes of my personal access token. I enabled workflow, which permits: Update GitHub Action workflows. This will allow you to push using: git push --set-upstream origin “add-auto-tests”.
The rest of your steps are correct, and it has nothing to do with using ssh or HTTPS. I hope it works for you.
Always give to Karma!

Hi rulesbyrosita,

I have struggled with the same problem for a few days and have researched everywhere. The thing that worked was this: git push --set-upstream origin add-auto-tests

1 Like

Thank you! It worked

1 Like