Skip to content

Repo sync #32294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ During set up, you may have [set your username in Git](/get-started/getting-star
```shell
$ git config user.name
# View the setting
YOUR_USERNAME
YOUR-USERNAME
```

## Finding your username in the URL of remote repositories
Expand All @@ -60,11 +60,11 @@ If you have any local copies of personal repositories you have created or forked
{% endtip %}

```shell
$ cd YOUR_REPOSITORY
$ cd YOUR-REPOSITORY
# Change directories to the initialized Git repository
$ git remote -v
origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_REPOSITORY.git (fetch)
origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_REPOSITORY.git (push)
origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git (fetch)
origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git (push)
```

Your user name is what immediately follows the `https://{% data variables.command_line.backticks %}/`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ For example, to clone a repository on the command line you would enter the follo

```shell
$ git clone https://{% data variables.command_line.codeblock %}/USERNAME/REPO.git
Username: YOUR_USERNAME
Password: YOUR_PERSONAL_ACCESS_TOKEN
Username: YOUR-USERNAME
Password: YOUR-PERSONAL-ACCESS-TOKEN
```

{% data variables.product.pat_generic_caps %}s can only be used for HTTPS Git operations. If your repository uses an SSH remote URL, you will need to [switch the remote from SSH to HTTPS](/get-started/getting-started-with-git/managing-remote-repositories#switching-remote-urls-from-ssh-to-https).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Every wiki provides an easy way to clone its contents down to your computer.
Once you've created an initial page on {% data variables.product.product_name %}, you can clone the repository to your computer with the provided URL:

```shell
$ git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.wiki.git
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY.wiki.git
# Clones the wiki locally
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ To render syntax highlighting in command line instructions and code samples, we
### Example usage of code syntax highlighting

```bash
git init YOUR_REPOSITORY
git init YOUR-REPOSITORY
```

Within the code sample syntax, use all uppercase text to indicate placeholder text or content that varies for each user, such as a user or repository name. By default, codeblocks will escape the content within the triple backticks. If you need to write sample code that parses the content (for example, to italicize text within `<em>` tags instead of passing the tags through literally), wrap the codeblock in `<pre>` tags.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ shortTitle: Configure a remote repository

```shell
$ git remote -v
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (push)
```

1. Specify a new remote _upstream_ repository that will be synced with the fork.
Expand All @@ -34,8 +34,8 @@ shortTitle: Configure a remote repository

```shell
$ git remote -v
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (push)
> upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
> upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
```
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ When you fork a project in order to propose changes to the upstream repository,
1. Change directories to the location of the fork you cloned.
- To go to your home directory, type just `cd` with no other text.
- To list the files and folders in your current directory, type `ls`.
- To go into one of your listed directories, type `cd your_listed_directory`.
- To go into one of your listed directories, type `cd YOUR-LISTED-DIRECTORY`.
- To go up one directory, type `cd ..`.
1. Type `git remote -v` and press **Enter**. You will see the current configured remote repository for your fork.

```shell
$ git remote -v
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (push)
```

1. Type `git remote add upstream`, and then paste the URL you copied in Step 3 and press **Enter**. It will look like this:
Expand All @@ -179,8 +179,8 @@ When you fork a project in order to propose changes to the upstream repository,

```shell
$ git remote -v
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-FORK.git (push)
> upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
> upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
```
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/data/ghec/enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
},
{
"action": "api.request",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is only available via audit log streaming.",
"docs_reference_links": "/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#enabling-audit-log-streaming-of-api-requests",
"fields": [
"user_agent",
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/data/ghes-3.10/enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@
},
{
"action": "api.request",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is only available via audit log streaming.",
"docs_reference_links": "/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#enabling-audit-log-streaming-of-api-requests",
"fields": [
"@timestamp",
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/data/ghes-3.11/enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@
},
{
"action": "api.request",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is only available via audit log streaming.",
"docs_reference_links": "/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#enabling-audit-log-streaming-of-api-requests",
"fields": [
"@timestamp",
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/data/ghes-3.12/enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@
},
{
"action": "api.request",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is only available via audit log streaming.",
"docs_reference_links": "/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#enabling-audit-log-streaming-of-api-requests",
"fields": [
"@timestamp",
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/data/ghes-3.13/enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@
},
{
"action": "api.request",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is only available via audit log streaming.",
"docs_reference_links": "/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#enabling-audit-log-streaming-of-api-requests",
"fields": [
"@timestamp",
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/data/ghes-3.9/enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@
},
{
"action": "api.request",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"description": "An API request was made to a security-significant endpoint for the enterprise. This event is only included if API Request Events is enabled in the enterprise's audit log settings. This event is only available via audit log streaming.",
"docs_reference_links": "/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#enabling-audit-log-streaming-of-api-requests",
"fields": [
"@timestamp",
Expand Down
5 changes: 4 additions & 1 deletion src/audit-logs/lib/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"apiOnlyEventsAdditionalDescription": "This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"appendedDescriptions": {
"apiOnlyEvents": "This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"apiRequestEvent": "This event is only available via audit log streaming."
},
"sha": "86e8c1638b4820a64a1e66501abd9e824b449b3e"
}
47 changes: 27 additions & 20 deletions src/audit-logs/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,11 @@ export function filterByAllowlistValues(

const minimal = {
action: event.action,
description: event.description,
description: processAndGetEventDescription(event, eventAllowlists, pipelineConfig),
docs_reference_links: event.docs_reference_links,
fields: event.fields,
}

if (
eventAllowlists.includes('org_api_only') ||
eventAllowlists.includes('business_api_only')
) {
minimal.description += ` ${pipelineConfig.apiOnlyEventsAdditionalDescription}`
}

minimalEvents.push(minimal)
}
}
Expand Down Expand Up @@ -167,19 +160,12 @@ export function filterAndUpdateGhesDataByAllowlistValues(
if (ghesVersionAllowlists === null) continue
if (seenByGhesVersion.get(fullGhesVersion)?.has(event.action)) continue

const minimal = {
action: event.action,
description: event.description,
docs_reference_links: event.docs_reference_links,
fields: event.ghes[ghesVersion].fields,
}

if (ghesVersionAllowlists.includes(allowListValue)) {
if (
ghesVersionAllowlists.includes('org_api_only') ||
ghesVersionAllowlists.includes('business_api_only')
) {
minimal.description += ` ${pipelineConfig.apiOnlyEventsAdditionalDescription}`
const minimal = {
action: event.action,
description: processAndGetEventDescription(event, ghesVersionAllowlists, pipelineConfig),
docs_reference_links: event.docs_reference_links,
fields: event.ghes[ghesVersion].fields,
}

// we need to initialize as we go to build up the `minimalEvents`
Expand Down Expand Up @@ -208,3 +194,24 @@ export function filterAndUpdateGhesDataByAllowlistValues(
}
}
}

function processAndGetEventDescription(event, allowlists, pipelineConfig) {
let description = event.description

// api.request is a unique event because it's an api_only event but is the only
// one of these events where the description we append isn't correct so we
// have to account for it separately. There's not yet anything in the schema
// we can hook onto to treat it differently.
if (
(allowlists.includes('org_api_only') || allowlists.includes('business_api_only')) &&
event.action !== 'api.request'
) {
description += ` ${pipelineConfig.appendedDescriptions.apiOnlyEvents}`
}

if (event.action === 'api.request') {
description += ` ${pipelineConfig.appendedDescriptions.apiRequestEvent}`
}

return description
}