Skip to content

Commit 9079c41

Browse files
docs: satisfy markdown linting warnings (#129)
* docs: satisfy markdown linting warnings this extension https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint * docs: add tip for using markdownlint extension to improve markdown formatting
1 parent 7840f13 commit 9079c41

File tree

3 files changed

+43
-28
lines changed

3 files changed

+43
-28
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ This means:
3333
### Documentation
3434

3535
I strive to maintain well-commented code. If a code segment is complex or not immediately clear, it should be accompanied by comments for clarity. When introducing new code or modifying existing code in a way that changes its function or usage, ensure it is properly documented both in the script and the respective `README.md` file.
36+
37+
> [!TIP]
38+
> Consider using the [markdownlint extension](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) for VS Code to help catch markdown formatting issues before submitting your PR.

gh-cli/README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ This directory contains scripts for interacting with the GitHub API / GraphQL us
99
#### macOS
1010

1111
```shell
12-
$ brew install gh # install gh cli on mac with brew
13-
$ brew upgrade gh # upgrade
12+
brew install gh # install gh cli on mac with brew
13+
brew upgrade gh # upgrade
1414
```
1515

1616
#### Windows
1717

1818
```shell
19-
$ choco install gh # install gh cli on windows with chocolatey
20-
$ choco upgrade gh # upgrade
19+
choco install gh # install gh cli on windows with chocolatey
20+
choco upgrade gh # upgrade
2121
```
2222

23-
MSI installer is available [here](https://github.com/cli/cli/releases/latest)
23+
[MSI installer](https://github.com/cli/cli/releases/latest) is available
2424

2525
#### Linux/other
2626

27-
Other operating systems and install methods can be found [here](https://github.com/cli/cli#installation)
27+
Other operating systems and install methods [are available](https://github.com/cli/cli#installation)
2828

29-
### Authentication
29+
### Authentication
3030

3131
#### Authenticate in the CLI
3232

@@ -51,6 +51,13 @@ $ export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
5151

5252
# authenticate to a GitHub Enterprise Server instance
5353
$ gh auth login -h github.mycompany.com # -h github.com is the default
54+
55+
# authenticate to a GitHub Enterprise Data Residency instance
56+
$ gh auth login -h tenant.ghe.com
57+
58+
# authenticate with an environment variable for the hostname
59+
$ export GH_HOST=github.mycompany.com #
60+
$ export GH_HOST=tenant.ghe.com
5461
```
5562

5663
#### Authenticate in GitHub Actions
@@ -370,9 +377,10 @@ It copies all [environments](https://docs.github.com/en/actions/deployment/targe
370377

371378
> [!NOTE]
372379
> The following settings are **not** copied:
373-
> - [Environment Variables](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-variables)
374-
> - [Custom Deployment Protection Rules](https://docs.github.com/en/actions/deployment/protecting-deployments/configuring-custom-deployment-protection-rules#using-existing-custom-deployment-protection-rules)
375-
> - Secrets
380+
>
381+
> - [Environment Variables](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-variables)
382+
> - [Custom Deployment Protection Rules](https://docs.github.com/en/actions/deployment/protecting-deployments/configuring-custom-deployment-protection-rules#using-existing-custom-deployment-protection-rules)
383+
> - Secrets
376384
377385
### copy-repository-variables.sh
378386

@@ -597,7 +605,7 @@ Generates release notes between two tags. See the [release notes docs](https://d
597605

598606
Generates a list of repos in the organization - has many uses, but the exported repos can be used in the `delete-repositories-from-list.sh` script.
599607

600-
Credits to @tspascoal from this repo: https://github.com/tspascoal/dependabot-alerts-helper
608+
*Credits to [@tspascoal](https://github.com/tspascoal) from this [repo](https://github.com/tspascoal/dependabot-alerts-helper)*
601609

602610
1. Run: `./generate-repositories.sh <org> > repos.csv`
603611

@@ -684,10 +692,10 @@ Count,Action
684692

685693
> [!TIP]
686694
> If outputting to `txt` or `md`, you'll see a warning message for each repository that returned an error (because Dependency Graph is disabled). You will also see an informational message providing context around what the count is returning. `csv` returns clean data.
687-
695+
<!-- -->
688696
> [!NOTE]
689697
> The count returned is the # of repositories that use the `action@version` combination - if a single repository uses the `action@version` combination 2x times, it will only be counted 1x (unless using `count-by-action` in combination with `--dedupe-by-repo`, which counts unique repositories per action). Conversely, if different `action@version` combinations are being used, they will be counted separately (for example, if the same action appears twice in a repository but one uses `@v2` and one uses `@v3`, by default they will be counted separately unless using `count-by-action` in combination with `--dedupe-by-repo`).
690-
698+
<!-- -->
691699
> [!NOTE]
692700
> Using `--resolve-shas` will add additional API calls, but we attempt to cache tag lookups to improve performance. The cache is stored in temporary files and automatically cleaned up when the script exits.
693701
@@ -735,9 +743,10 @@ Gets all users who have created an issue, pull request, issue comment, or pull r
735743
Generates a JWT for a GitHub app and use that JWT to generate installation tokens for each org installation. The installation tokens, returned as `ghs_abc`, can then be used for normal API calls. It requires the App ID and Private Key `pem` file as input.
736744

737745
> [!NOTE]
746+
>
738747
> - Not using `gh-cli` since we have to pass in JWT using `curl` (but otherwise no PAT required)
739748
> - Similar script to [get-apps-installed-in-organization.sh](./../scripts/get-app-tokens-for-each-installation.sh), but this one doesn't have a python dependency
740-
> - Thanks [@kenmuse](https://github.com/kenmuse) for the [starter](https://gist.github.com/kenmuse/9429221d6944c087deaed2ec5075d0bf)!
749+
> - Thanks [@kenmuse](https://github.com/kenmuse) for the [starter](https://gist.github.com/kenmuse/9429221d6944c087deaed2ec5075d0bf)!
741750
742751
### get-apps-installed-in-organization.sh
743752

@@ -775,7 +784,7 @@ Gets the commits of since a certain date - date should be in [ISO 8601](https://
775784

776785
Gets dependencies used in the repository, including the ecosystem and version number.
777786

778-
Example output:
787+
Example output:
779788

780789
```csv
781790
npm/source-list-map@2.0.1
@@ -809,8 +818,8 @@ Get the enterprise ID used for other GraphQL calls. Use the URL slug of the Ente
809818

810819
Adding `-H X-Github-Next-Global-ID:1` per the documentation here to get the new ID format:
811820

812-
- https://github.blog/changelog/2022-11-10-graphql-legacy-global-id-deprecation-message/
813-
- https://docs.github.com/en/graphql/guides/migrating-graphql-global-node-ids
821+
- [GraphQL Legacy Global ID Deprecation (November 10, 2022)](https://github.blog/changelog/2022-11-10-graphql-legacy-global-id-deprecation-message/)
822+
- [Migrating GraphQL Global Node IDs - GitHub Docs](https://docs.github.com/en/graphql/guides/migrating-graphql-global-node-ids)
814823

815824
### get-enterprise-ip-allow-list.sh
816825

@@ -928,8 +937,8 @@ Get the organization ID used for other GraphQL calls. Use the login of the Organ
928937

929938
Adding `-H X-Github-Next-Global-ID:1` per the documentation here to get the new ID format:
930939

931-
- https://github.blog/changelog/2022-11-10-graphql-legacy-global-id-deprecation-message/
932-
- https://docs.github.com/en/graphql/guides/migrating-graphql-global-node-ids
940+
- [GraphQL Legacy Global ID Deprecation (November 10, 2022)](https://github.blog/changelog/2022-11-10-graphql-legacy-global-id-deprecation-message/)
941+
- [Migrating GraphQL Global Node IDs - GitHub Docs](https://docs.github.com/en/graphql/guides/migrating-graphql-global-node-ids)
933942

934943
### get-organization-ip-allow-list.sh
935944

scripts/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ node ./add-dependabot-file-to-repositories.js ./repos.txt ./dependabot.yml
2020

2121
The `repos.txt` should be in the following format:
2222

23-
```
23+
```text
2424
joshjohanning-org/test-repo-1
2525
joshjohanning-org/test-repo-2
2626
joshjohanning-org/test-repo-3
@@ -65,15 +65,18 @@ This script will generate generate a JWT for a GitHub app and use that JWT to ge
6565

6666
Output example:
6767

68-
> Getting installation token for: Josh-Test ...
69-
>
70-
> ... token: ghs_abc
71-
>
72-
> Getting installation token for: joshjohanning-org ...
73-
>
74-
> ... token: ghs_xyz
68+
```text
69+
Getting installation token for: Josh-Test ...
70+
71+
... token: ghs_abc
72+
73+
Getting installation token for: joshjohanning-org ...
74+
75+
... token: ghs_xyz
76+
```
7577

7678
Docs:
79+
7780
- [Generate a JWT for a GitHub App](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app#example-using-python-to-generate-a-jwt)
7881
- [Generating an installation access token for a GitHub App](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app#generating-an-installation-access-token)
7982
- [List installations for the authenticated app](https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#list-installations-for-the-authenticated-app)
@@ -117,7 +120,7 @@ Migrate npm packages in GitHub Packages from one GitHub organization to another.
117120

118121
## migrate-nuget-packages-between-github-instances.sh
119122

120-
Migrate NuGet packages in GitHub Packages from one GitHub organization to another. Runs script from upstream [source](https://github.com/joshjohanning/github-packages-migrate-nuget-packages-between-github-instances).
123+
Migrate NuGet packages in GitHub Packages from one GitHub organization to another. Runs script from upstream [source](https://github.com/joshjohanning/github-packages-migrate-nuget-packages-between-github-instances).
121124

122125
1. Define the source GitHub PAT env var: `export GH_SOURCE_PAT=ghp_abc` (must have at least `read:packages`, `read:org` scope)
123126
2. Define the target GitHub PAT env var: `export GH_TARGET_PAT=ghp_abc` (must have at least `write:packages`, `read:org` scope)

0 commit comments

Comments
 (0)