Skip to content

Commit 507bd11

Browse files
committed
Updates based on dry run
1 parent 81442fb commit 507bd11

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

content/guided-workshop/exercises/6-github-flow.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,61 +25,69 @@ There are different ways to create a branch when using [GitHub Codespaces](https
2525

2626
1. Return to your codespace, or reopen it by navigating to your repository and selecting **Code** > **Codespaces** and the name of your codespace.
2727
1. Open a **terminal window** by pressing <kbd>Ctl</kbd> + <kbd>`</kbd>.
28-
1. In the terminal window, enter the following command to create and switch to a new branch named `add-hours` and pressing <kbd>Enter</kbd> (or <kbd>Return</kbd> on a Mac)::
28+
1. In the terminal window, enter the following command to create and switch to a new branch named `add-hours`:
2929

3030
```bash
3131
git checkout -b add-hours
3232
```
3333

34-
1. Stage all code to be committed to the new branch by entering the following command in the terminal window and pressing <kbd>Enter</kbd> (or <kbd>Return</kbd> on a Mac):
34+
1. Stage all code to be committed to the new branch by entering the following command in the terminal window:
3535

3636
```bash
3737
git add .
3838
```
3939

40-
1. Commit all changes with a message describing what's been updated by entering the following command in the terminal window and pressing <kbd>Enter</kbd> (or <kbd>Return</kbd> on a Mac):
40+
1. Commit all changes with a message describing what's been updated by entering the following command in the terminal window:
4141
4242
```bash
4343
git commit -m "Added hours component"
4444
```
4545
46-
1. Finally, push the new branch to the repository by entering the following command in the terminal window and pressing <kbd>Enter</kbd> (or <kbd>Return</kbd> on a Mac):
46+
1. Finally, push the new branch to the repository by entering the following command in the terminal window:
4747
4848
```bash
4949
git push -u origin add-hours
5050
```
5151
52-
## Create the pull request
52+
## Create the pull request to suggest updates
5353
5454
A [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) is a request to pull or incorporate new code into the existing codebase. When a pull request is made it's customary to have other team members review the code and make comments, and for [CI/CD](https://resources.github.com/ci-cd/) processes to run. Once everything is completed and the code is in a stage where everyone has signed-off, it's then merged into the codebase.
5555
5656
Pull requests can be made through the source control pane in the codespace, the repository's website, or through the command-line using the [GitHub CLI](https://cli.github.com/). In our example we're going to create the pull request in the CLI, then navigate to the website to see the pull request and the actions running, and merge the code into the codebase.
5757
5858
1. Return to your codespace.
59-
1. Find the number for the [issue you created earlier](./2-issues.md) titled **Add component to display hours** by entering the following command in the terminal window and pressing <kbd>Enter</kbd> (or <kbd>Return</kbd> on a Mac):
59+
1. Find the number for the [issue you created earlier](./2-issues.md) titled **Add component to display hours** by entering the following command in the terminal window:
6060
6161
```bash
6262
gh issue list
6363
```
6464
65-
1. Create a pull request with the title **Add hours component** and body **Resolves #\<ISSUE_NUMBER\>**, replacing **\<ISSUE_NUMBER\>** with the issue number you obtained in the previous step by entering the following command in the terminal window and pressing <kbd>Enter</kbd> (or <kbd>Return</kbd> on a Mac):
65+
1. Create a pull request with the title **Add hours component** and body **Resolves #\<ISSUE_NUMBER\>**, replacing **\<ISSUE_NUMBER\>** with the issue number you obtained in the previous step by entering the following command in the terminal window:
6666
6767
```bash
6868
gh pr create -t "Add hours component" -b "Resolves #<ISSUE_NUMBER>"
6969
```
7070
71-
## Merge the pull request
71+
## Explore and merge the pull request
7272
73-
When the pull request is created, you will see a link appear to the page for the pull request. From there you can add comments, see any workflows running, and decide to close or merge the pull request. Let's ensure the tests now run successfully and, assuming they do, merge the pull request.
73+
When the pull request is created, you will see a link appear to the page for the pull request. From there you can add comments, see any workflows running, and decide to close or merge the pull request. You can also see any workflows associated with the pull request run.
74+
75+
In our scenario, we created an automated workflow for front-end tests for our application, which runs whenever a push or pull request is made to `main`. We also enabled [code scanning](../exercises/1-code-scanning.md), which was set to run on the same triggers. We've just created a pull request, which will cause both of those workflows to run!
76+
77+
Let's explore the pull request and watch the workflows run. We'll ensure the tests now run successfully and, assuming they do, merge the pull request.
7478

7579
1. Follow the link displayed in the terminal window by using <kbd>Ctl</kbd> - **Click** (or <kbd>Cmd</kbd> - **Click** on a Mac).
76-
1. In the page displayed, note the workflow running the [end-to-end tests created earlier](./4-testing.md).
77-
1. When the test passes successfully, select **Merge pull request** to merge your changes into the **main** branch.
80+
1. In the page displayed, note the workflow running the [end-to-end tests created earlier](./4-testing.md) and [code scanning](../exercises/1-code-scanning.md).
81+
1. When the workflows complete successfully, select **Merge pull request** to merge your changes into the **main** branch.
7882

7983
Congratulations! You've now used the GitHub flow to suggest changes, perform a review, and merge those into your codebase.
8084
8185
## Summary and next steps
8286
8387
The GitHub flow is a workflow for managing changes and incorporating new features into a codebase. GitHub flow gives you the freedom to explore and experiment, while ensuring all code follows a validation process before being merged. With the code updated, it's time to deploy the project! The first step is to [create the deployment environment](./7-create-environment.md).
8488

85-
## Resources
89+
## Resources
90+
91+
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
92+
- [GitHub Skills: Review pull requests](https://github.com/skills/review-pull-requests)
93+
- [GitHub Skills: Release based workflow](https://github.com/skills/release-based-workflow)

0 commit comments

Comments
 (0)