Commit and push the sample file and workflow updates
In this step, you will commit your changes and push them to GitHub. Pushing this commit will trigger the workflow we defined because of the on: [push] configuration.
- Ensure you are in the repository directory:
cd ~/project/github-actions-demo
- Check the status of your repository to see the untracked files:
git status
You should see .github/workflows/ci.yml and index.js as untracked.
- Stage all changes:
git add .
- Commit the changes with a descriptive message:
git commit -m "Add CI workflow and index.js"
Example Output:
[main ... ] Add CI workflow and index.js
2 files changed, 14 insertions(+), 0 deletions(-)
create mode 100644 .github/workflows/ci.yml
create mode 100644 index.js
- Push the changes to the remote repository on GitHub:
git push
Note on Authentication:
When you run git push, the WebIDE will automatically prompt you to authenticate. Follow these detailed steps:
- A popup will appear with the message: "The extension 'GitHub' wants to sign in using GitHub." Click Allow.
- A new notification will appear. Click "Copy&Continue to GitHub", then click "Open" in the next prompt.
- Log in to your GitHub account in the browser window that opens, and enter the authorization code that was copied. After confirming the authorization, the page will automatically close.
- Wait a few seconds, and you will see the terminal successfully complete the push operation.
Privacy Note: The WebIDE will request full access to your GitHub account for authentication purposes. You don't need to worry about privacy concerns - the LabEx VM will be immediately destroyed after you complete the current lab, and your credentials and authorization information will not be retained.
This authentication process does not require manual configuration of username or Personal Access Token.
Example Output:
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 512 bytes | 512.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
To https://github.com/your-username/github-actions-demo.git
1234567..abcdef1 main -> main
This push triggers the workflow on GitHub.