Skip to content

Commit fbee91e

Browse files
authored
Merge branch 'main' into patch-2
2 parents 5133b09 + 89fa131 commit fbee91e

File tree

470 files changed

+4144
-1844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

470 files changed

+4144
-1844
lines changed

.github/workflows/azure-preview-env-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ permissions:
3434

3535
# This allows one deploy workflow to interrupt another
3636
concurrency:
37-
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label }}'
37+
group: 'preview-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || github.event.inputs.PR_NUMBER }}'
3838
cancel-in-progress: true
3939

4040
jobs:

.github/workflows/azure-preview-env-destroy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ on:
1919
permissions:
2020
contents: read
2121

22+
# This allows one deploy workflow to interrupt another
23+
concurrency:
24+
group: 'preview-env @ ${{ github.head_ref || github.run_id }} for ${{ github.event.number || github.event.inputs.PR_NUMBER }}'
25+
cancel-in-progress: true
26+
2227
jobs:
2328
destory-azure-preview-env:
2429
name: Destroy

.github/workflows/optimize-images.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
git checkout $GITHUB_HEAD_REF
4242
4343
echo "List the files that changed"
44-
git diff --name-only $GITHUB_HEAD_REF $GITHUB_BASE_REF
44+
git diff --name-only --diff-filter=d $GITHUB_BASE_REF $GITHUB_HEAD_REF
4545
4646
echo "Run optipng on pngs in from the diff"
47-
git diff --name-only -z $GITHUB_HEAD_REF $GITHUB_BASE_REF -- '*.png' | xargs -0 optipng -nx
47+
git diff --name-only -z --diff-filter=d $GITHUB_BASE_REF $GITHUB_HEAD_REF -- '*.png' | xargs -0 optipng -nx
4848
4949
- name: Make a commit and a push
5050
run: |

components/release-notes/PatchNotes.module.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "@primer/css/layout/index.scss";
2-
31
.sectionHeading {
42
scroll-margin-top: 70px !important;
53
}

content/actions/automating-builds-and-tests/building-and-testing-net.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
runs-on: ubuntu-latest
8686
strategy:
8787
matrix:
88-
dotnet: [ '3.0', '3.1.x', '5.0.x' ]
88+
dotnet-version: [ '3.0', '3.1.x', '5.0.x' ]
8989
9090
steps:
9191
- uses: actions/checkout@v2

content/actions/learn-github-actions/understanding-github-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can configure a {% data variables.product.prodname_actions %} _workflow_ to
3838

3939
A workflow is a configurable automated process that will run one or more jobs. Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.
4040

41-
Your repository can have multiple workflows in a repository, each of which can perform a different set of steps. For example, you can have one workflow to build and test pull requests, another workflow to deploy your application every time a release is created, and still another workflow that adds a label every time someone opens a new issue.
41+
You can have multiple workflows in a repository, each of which can perform a different set of steps. For example, you can have one workflow to build and test pull requests, another workflow to deploy your application every time a release is created, and still another workflow that adds a label every time someone opens a new issue.
4242

4343
{% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}You can reference a workflow within another workflow, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."{% endif %}
4444

@@ -266,4 +266,4 @@ To understand how billing works for {% data variables.product.prodname_actions %
266266
## Further reading
267267
268268
{% ifversion ghec or ghes or ghae %}
269-
- "[About {% data variables.product.prodname_actions %} for enterprises](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises)"{% endif %}
269+
- "[About {% data variables.product.prodname_actions %} for enterprises](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises)"{% endif %}

content/actions/using-workflows/events-that-trigger-workflows.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,25 @@ on:
685685

686686
{% endnote %}
687687

688+
#### Running your workflow when a pull request merges
689+
690+
When a pull request merges, the pull request is automatically closed. To run a workflow when a pull request merges, use the `pull_request` `closed` event type along with a conditional that checks the `merged` value of the event. For example, the following workflow will run whenever a pull request closes. The `if_merged` job will only run if the pull request was also merged.
691+
692+
```yaml
693+
on:
694+
pull_request:
695+
types:
696+
- closed
697+
698+
jobs:
699+
if_merged:
700+
if: github.event.pull_request.merged == true
701+
runs-on: ubuntu-latest
702+
steps:
703+
- run: |
704+
echo The PR was merged
705+
```
706+
688707
{% data reusables.developer-site.pull_request_forked_repos_link %}
689708

690709
### `pull_request_comment` (use `issue_comment`)
@@ -869,6 +888,25 @@ on:
869888

870889
{% endnote %}
871890

891+
#### Running your workflow when a pull request merges
892+
893+
When a pull request merges, the pull request is automatically closed. To run a workflow when a pull request merges, use the `pull_request_target` `closed` event type along with a conditional that checks the `merged` value of the event. For example, the following workflow will run whenever a pull request closes. The `if_merged` job will only run if the pull request was also merged.
894+
895+
```yaml
896+
on:
897+
pull_request_target:
898+
types:
899+
- closed
900+
901+
jobs:
902+
if_merged:
903+
if: github.event.pull_request_target.merged == true
904+
runs-on: ubuntu-latest
905+
steps:
906+
- run: |
907+
echo The PR was merged
908+
```
909+
872910
### `push`
873911

874912
| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |

content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ When you have decided on the most secure and reliable method for your CI server,
223223
| Option | Required | Usage |
224224
|--------|:--------:|-----|
225225
| <nobr>`--repository`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the *OWNER/NAME* of the repository to upload data to. The owner must be an organization within an enterprise that has a license for {% data variables.product.prodname_GH_advanced_security %} and {% data variables.product.prodname_GH_advanced_security %} must be enabled for the repository{% ifversion fpt or ghec %}, unless the repository is public{% endif %}. For more information, see "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)."
226-
| <nobr>`--ref`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the name of the `ref` you checked out and analyzed so that the results can be matched to the correct code. For a branch use: `refs/heads/BRANCH-NAME`, for the head commit of a pull request use `refs/pulls/NUMBER/head`, or for the {% data variables.product.prodname_dotcom %}-generated merge commit of a pull request use `refs/pulls/NUMBER/merge`.
226+
| <nobr>`--ref`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the name of the `ref` you checked out and analyzed so that the results can be matched to the correct code. For a branch use: `refs/heads/BRANCH-NAME`, for the head commit of a pull request use `refs/pull/NUMBER/head`, or for the {% data variables.product.prodname_dotcom %}-generated merge commit of a pull request use `refs/pull/NUMBER/merge`.
227227
| <nobr>`--commit`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the full SHA of the commit you analyzed.
228228
| <nobr>`--sarif`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the SARIF file to load.{% ifversion ghes > 3.0 or ghae %}
229229
| <nobr>`--github-url`</nobr> | {% octicon "check-circle-fill" aria-label="Required" %} | Specify the URL for {% data variables.product.product_name %}.{% endif %}

content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/migrating-from-the-codeql-runner-to-codeql-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ These examples also assume that the {% data variables.product.prodname_codeql_cl
5353

5454
In these examples, a {% data variables.product.prodname_dotcom %} token with suitable scopes is stored in the `$TOKEN` environment variable and passed to the example commands via `stdin`, or is stored in the `$GITHUB_TOKEN` environment variable.
5555

56-
The ref name and commit SHA being checked out and analyzed in these examples are known during the workflow. For a branch, use `refs/heads/BRANCH-NAME` as the ref. For the head commit of a pull request, use `refs/pulls/NUMBER/head`. For a {% data variables.product.prodname_dotcom %}-generated merge commit of a pull request, use `refs/pulls/NUMBER/merge`. The examples below all use `refs/heads/main`. If you use a different branch name, you must modify the sample code.
56+
The ref name and commit SHA being checked out and analyzed in these examples are known during the workflow. For a branch, use `refs/heads/BRANCH-NAME` as the ref. For the head commit of a pull request, use `refs/pull/NUMBER/head`. For a {% data variables.product.prodname_dotcom %}-generated merge commit of a pull request, use `refs/pull/NUMBER/merge`. The examples below all use `refs/heads/main`. If you use a different branch name, you must modify the sample code.
5757

5858
### Single non-compiled language (JavaScript)
5959

content/get-started/quickstart/hello-world.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,28 @@ In this quickstart guide, you will:
2626
* Make changes to a file and push them to {% data variables.product.product_name %} as commits
2727
* Open and merge a pull request
2828

29-
To complete this tutorial, you need a [{% data variables.product.product_name %} account](http://github.com) and Internet access. You don't need to know how to code, use the command line, or install Git (the version control software that {% data variables.product.product_name %} is built on).
29+
To complete this tutorial, you need a [{% data variables.product.product_name %} account](http://github.com) and Internet access. You don't need to know how to code, use the command line, or install Git (the version control software that {% data variables.product.product_name %} is built on). If you have a question about any of the expressions used in this guide, head on over to the [glossary](/get-started/quickstart/github-glossary) to find out more about our terminology.
3030

3131
## Creating a repository
3232

33-
A repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, and data sets -- anything your project needs. Often, repositories include a `README` file, a file with information about your project. {% data variables.product.product_name %} makes it easy to add one at the same time you create your new repository. It also offers other common options such as a license file.
33+
A repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, and data sets -- anything your project needs. Often, repositories include a _README_ file, a file with information about your project. _README_ files are written in the plain text Markdown language. You can use this [cheat sheet](https://www.markdownguide.org/cheat-sheet/) to get started with Markdown syntax. {% data variables.product.product_name %} lets you add a _README_ file at the same time you create your new repository. {% data variables.product.product_name %} also offers other common options such as a license file, but you do not have to select any of them now.
3434

3535
Your `hello-world` repository can be a place where you store ideas, resources, or even share and discuss things with others.
3636

3737
{% data reusables.repositories.create_new %}
3838
1. In the **Repository name** box, enter `hello-world`.
3939
2. In the **Description** box, write a short description.
4040
3. Select **Add a README file**.
41-
4. Click **Create repository**.
41+
4. Select whether your repository will be **Public** or **Private**.
42+
5. Click **Create repository**.
4243

4344
![Create a hello world repository](/assets/images/help/repository/hello-world-repo.png)
4445

4546
## Creating a branch
4647

4748
Branching lets you have different versions of a repository at one time.
4849

49-
By default, your repository has one branch named `main` that is considered to be the definitive branch. You can use branches to experiment and make edits before committing them to `main`.
50+
By default, your repository has one branch named `main` that is considered to be the definitive branch. You can create additional branches off of `main` in your repository. You can use branches to have different versions of a project at one time. This is helpful when you want to add new features to a project without changing the main source of code. The work done on different branches will not show up on the main branch until you merge it, which we will cover later in this guide. You can use branches to experiment and make edits before committing them to `main`.
5051

5152
When you create a branch off the `main` branch, you're making a copy, or snapshot, of `main` as it was at that point in time. If someone else made changes to the `main` branch while you were working on your branch, you could pull in those updates.
5253

@@ -61,8 +62,8 @@ This diagram shows:
6162
Have you ever saved different versions of a file? Something like:
6263

6364
* `story.txt`
64-
* `story-joe-edit.txt`
65-
* `story-joe-edit-reviewed.txt`
65+
* `story-edit.txt`
66+
* `story-edit-reviewed.txt`
6667

6768
Branches accomplish similar goals in {% data variables.product.product_name %} repositories.
6869

@@ -86,9 +87,9 @@ When you created a new branch in the previous step, {% data variables.product.pr
8687

8788
You can make and save changes to the files in your repository. On {% data variables.product.product_name %}, saved changes are called commits. Each commit has an associated commit message, which is a description explaining why a particular change was made. Commit messages capture the history of your changes so that other contributors can understand what you’ve done and why.
8889

89-
1. Click the `README.md` file.
90-
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the file.
91-
3. In the editor, write a bit about yourself.
90+
1. Under the `readme-edits` branch you created, click the _README.md_ file.
91+
2. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the file.
92+
3. In the editor, write a bit about yourself. Try using different Markdown elements.
9293
4. In the **Commit changes** box, write a commit message that describes your changes.
9394
5. Click **Commit changes**.
9495

@@ -117,17 +118,23 @@ You can even open pull requests in your own repository and merge them yourself.
117118

118119
5. Click **Create pull request**.
119120
6. Give your pull request a title and write a brief description of your changes. You can include emojis and drag and drop images and gifs.
121+
7. Optionally, to the right of your title and description, click the {% octicon "gear" aria-label="The Gear icon" %} next to **Reviewers**. **Assignees**, **Labels**, **Projects**, or **Milestone** to add any of these options to your pull request. You do not need to add any yet, but these options offer different ways to collaborate using pull requests. For more information, see "[About pull requests](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)."
120122
7. Click **Create pull request**.
121123

122124
Your collaborators can now review your edits and make suggestions.
123125

124126
## Merging your pull request
125127

126-
In this final step, you will merge your `readme-edits` branch into the `main` branch.
128+
In this final step, you will merge your `readme-edits` branch into the `main` branch. After you merge your pull request, the changes on your `readme-edits` branch will be incorporated into `main`.
129+
130+
Sometimes, a pull request may introduce changes to code that conflict with the existing code on `main`. If there are any conflicts, {% data variables.product.product_name %} will alert you about the conflicting code and prevent merging until the conflicts are resolved. You can make a commit that resolves the conflicts or use comments in the pull request to discuss the conflicts with your team members.
131+
132+
In this walk-through, you should not have any conflicts, so you are ready to merge your branch into the main branch.
127133

128134
1. Click **Merge pull request** to merge the changes into `main`.
129-
2. Click **Confirm merge**.
130-
3. Go ahead and delete the branch, since its changes have been incorporated, by clicking **Delete branch**.
135+
![Screen shot of merge button.](/assets/images/help/pull_requests/pullrequest-mergebutton.png)
136+
2. Click **Confirm merge**. You will receive a message that the request was successfully merged and the request was closed.
137+
3. Click **Delete branch**. Now that your pull request is merged and your changes are on `main`, you can safely delete the `readme-edits` branch. If you want to make more changes to your project, you can always create a new branch and repeat this process.
131138

132139
## Next steps
133140

0 commit comments

Comments
 (0)