Skip to content

Commit 68b7318

Browse files
authored
Add changelog authorization docs (#2474)
1 parent b84df3b commit 68b7318

File tree

1 file changed

+34
-14
lines changed

1 file changed

+34
-14
lines changed

docs/contribute/changelog.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,15 @@
22

33
By adding a file for each notable change and grouping them into bundles, you can ultimately generate release documention with a consistent layout for all your products.
44

5-
1. Create changelogs with the `docs-builder changelog add` command.
6-
2. [Create changelog bundles](#changelog-bundle) with the `docs-builder changelog bundle` command. For example, create a bundle for the pull requests that are included in a product release.
7-
3. [Create documentation](#render-changelogs) with the `docs-builder changelog render` command.
8-
9-
For more information about running `docs-builder`, go to [Contribute locally](https://www.elastic.co/docs/contribute-docs/locally).
10-
11-
:::{note}
12-
This command is associated with an ongoing release docs initiative.
13-
Additional workflows are still to come for updating and generating documentation from changelogs.
14-
:::
15-
165
The changelogs use the following schema:
176

187
:::{dropdown} Changelog schema
198
::::{include} /contribute/_snippets/changelog-fields.md
209
::::
2110
:::
2211

23-
Some of the fields in the schema accept only a specific set of values:
24-
2512
:::{important}
13+
Some of the fields in the schema accept only a specific set of values:
2614

2715
- Product values must exist in [products.yml](https://github.com/elastic/docs-builder/blob/main/config/products.yml). Invalid products will cause the `docs-builder changelog add` command to fail.
2816
- Type, subtype, and lifecycle values must match the available values defined in [ChangelogConfiguration.cs](https://github.com/elastic/docs-builder/blob/main/src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs). Invalid values will cause the `docs-builder changelog add` command to fail.
@@ -36,6 +24,15 @@ To use the `docs-builder changelog` commands in your development workflow:
3624
1. Optional: Add labels to your GitHub pull requests to indicate that they are not notable and should not generate changelogs. For example, `non-issue` or `release_notes:skip`.
3725
1. [Configure changelog settings](#changelog-settings) to correctly interpret your PR labels.
3826
1. [Create changelogs](#changelog-add) with the `docs-builder changelog add` command.
27+
1. [Create changelog bundles](#changelog-bundle) with the `docs-builder changelog bundle` command. For example, create a bundle for the pull requests that are included in a product release.
28+
1. [Create documentation](#render-changelogs) with the `docs-builder changelog render` command.
29+
30+
For more information about running `docs-builder`, go to [Contribute locally](https://www.elastic.co/docs/contribute-docs/locally).
31+
32+
:::{note}
33+
This command is associated with an ongoing release docs initiative.
34+
Additional workflows are still to come for updating and generating documentation from changelogs.
35+
:::
3936

4037
## Create a changelog configuration file [changelog-settings]
4138

@@ -115,7 +112,12 @@ Refer to [changelog.yml.example](https://github.com/elastic/docs-builder/blob/ma
115112
## Create changelog files [changelog-add]
116113

117114
You can use the `docs-builder changelog add` command to create a changelog file.
118-
For up-to-date details, use the `-h` option:
115+
116+
:::{tip}
117+
Ideally this task will be automated such that it's performed by a bot or GitHub action when you create a pull request. More details to come as we refine the workflows.
118+
:::
119+
120+
For up-to-date command usage information, use the `-h` option:
119121

120122
```sh
121123
Add a new changelog from command-line input
@@ -140,6 +142,24 @@ Options:
140142
--use-pr-number Optional: Use the PR number as the filename instead of generating it from a unique ID and title
141143
```
142144

145+
### Authorization
146+
147+
If you use the `--prs` option, the `docs-builder changelog add` command interacts with GitHub services.
148+
Log into GitHub or set the `GITHUB_TOKEN` (or `GH_TOKEN` ) environment variable with a sufficient personal access token (PAT).
149+
Otherwise, there will be fetch failures when you access private repositories and you might also encounter GitHub rate limiting errors.
150+
151+
For example, to create a new token with the minimum authority to read pull request details:
152+
153+
1. Go to **GitHub Settings** > **Developer settings** > **Personal access tokens** > [Fine-grained tokens](https://github.com/settings/personal-access-tokens).
154+
2. Click **Generate new token**.
155+
3. Give your token a descriptive name (such as "docs-builder changelog").
156+
4. Under **Resource owner** if you're an Elastic employee, select **Elastic**.
157+
5. Set an expiration date.
158+
6. Under **Repository access**, select **Only select repositories** and choose the repositories you want to access.
159+
7. Under **Permissions** > **Repository permissions**, set **Pull requests** to **Read-only**.
160+
8. Click **Generate token**.
161+
9. Copy the token to a safe location and use it in the `GITHUB_TOKEN` environment variable.
162+
143163
### Product format
144164

145165
The `docs-builder changelog add` has a `--products` option and the `docs-builder changelog bundle` has `--input-products` and `--output-products` options that all use the same format.

0 commit comments

Comments
 (0)