Commit 446fc0e5 authored by Suzanne Selhorn's avatar Suzanne Selhorn

Merge branch '322885-aqualls-fix-examples' into 'master'

Revisions to the examples area

See merge request gitlab-org/gitlab!55397
parents 92600e14 083f63b4
...@@ -337,38 +337,41 @@ attribute. ...@@ -337,38 +337,41 @@ attribute.
### Examples ### Examples
For these examples we use the project ID 42, and assume the project is hosted on These examples use [cURL](https://curl.se/) to perform HTTP requests.
GitLab.com. The example API token we use is `token`. We use The example commands use these values:
[curl](https://curl.se/) to perform the HTTP requests.
Let's start with a basic example: - **Project ID**: 42
- **Location**: hosted on GitLab.com
- **Example API token**: `token`
This command generates a changelog for version `1.0.0`.
The commit range:
- Starts with the tag of the last release.
- Ends with the last commit on the target branch. The default target branch is the project's default branch.
If the last tag is `v0.9.0` and the default branch is `main`, the range of commits
included in this example is `v0.9.0..main`:
```shell ```shell
curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0" "https://gitlab.com/api/v4/projects/42/repository/changelog" curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0" "https://gitlab.com/api/v4/projects/42/repository/changelog"
``` ```
This generates a changelog for version `1.0.0`. The start of the range of To generate the data on a different branch, specify the `branch` parameter. This
commits to include is the tag of the last release. The end of the range is the command generates data from the `foo` branch:
last commit on the target branch, which defaults to the project's default
branch. So if the last tag is `v0.9.0`, and the default branch is `main`, this
means the range of commits is `v0.9.0..main`.
If you want to generate the data on a different branch, you can do so as
follows:
```shell ```shell
curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&branch=foo" "https://gitlab.com/api/v4/projects/42/repository/changelog" curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&branch=foo" "https://gitlab.com/api/v4/projects/42/repository/changelog"
``` ```
This generates the data on the `foo` branch. To use a different trailer, use the `trailer` parameter:
A different trailer to use is specified as follows:
```shell ```shell
curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&trailer=Type" "https://gitlab.com/api/v4/projects/42/repository/changelog" curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&trailer=Type" "https://gitlab.com/api/v4/projects/42/repository/changelog"
``` ```
Or perhaps you want to store the results in a different file: To store the results in a different file, use the `file` parameter:
```shell ```shell
curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&file=NEWS" "https://gitlab.com/api/v4/projects/42/repository/changelog" curl --header "PRIVATE-TOKEN: token" --data "version=1.0.0&file=NEWS" "https://gitlab.com/api/v4/projects/42/repository/changelog"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment