Skip to content

Commit 70efac2

Browse files
committed
Update README.md
1 parent a8533c7 commit 70efac2

File tree

2 files changed

+21
-36
lines changed

2 files changed

+21
-36
lines changed

create-release/README.md

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@ This action creates a release on GitHub:
55
2. Computing the checksum for the archived tarball.
66
3. Extracting the release notes from the changelog.
77

8-
## GitHub Action Usage
8+
## Action Inputs
99

10-
Requirements:
11-
- `contents: write` permission to the repository
12-
- (optional) Python >=3.7
10+
| Name | Description | Default |
11+
| ---- | ----------- | ------- |
12+
| `version` | Version to release. | **Required** |
13+
| `branch` | Target branch to use for the release. | **Required** |
14+
| `archive-name` | Name of the git archive to create. | `${{ github.event.repository.name }}-${{ inputs.version }}` |
15+
| `output-directory` | Directory for the release artifacts. | `release` |
16+
| `release-notes` | Name of the release notes to create. | `RELEASE_NOTES.md` |
17+
| `release-token` | GitHub token to create the release.<br>Fine-grained PAT: `contents: write` | `${{ github.token }}` |
18+
19+
## Sample Workflows
20+
21+
### Basic Workflow
1322

1423
```yaml
1524
name: Create Release
@@ -31,33 +40,11 @@ jobs:
3140
- name: Create Release
3241
uses: conda/actions/create-release
3342
with:
34-
# [required]
35-
# the version to be released
3643
version: ${{ inputs.version }}
37-
38-
# [required]
39-
# the target branch for the release
4044
branch: main
41-
42-
# [optional]
43-
# name of the tarball archive
44-
# archive-name: ${{ github.event.repository.name }}-${{ github.ref_name }}
45-
46-
# [optional]
47-
# directory for the release artifacts
48-
# output-directory: release
49-
50-
# [optional]
51-
# path to the release notes
52-
# release-notes: RELEASE_NOTES.md
53-
54-
# [optional]
55-
# GitHub token to author release
56-
# (`contents: write` for fine-grained PAT; `repo` for classic PAT)
57-
# token: ${{ github.token }}
5845
```
5946
60-
### Sample Workflow Creating Release using Dynamic Branch
47+
### Dynamic Branch Workflow
6148
6249
```yaml
6350
name: Create Release

create-release/action.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@ name: Create Release
22
description: Creates a release by archiving the source and creating a release on GitHub.
33
inputs:
44
version:
5-
description: Release version.
5+
description: Version to release.
66
required: true
77
branch:
88
description: Target branch for the release.
9-
required: true
9+
default: ${{ github.event.repository.default_branch }}
1010
archive-name:
11-
description: Name of the tarball archive.
12-
default: ${{ github.event.repository.name }}-${{ github.ref_name }}
11+
description: Name of the git archive.
12+
default: ${{ github.event.repository.name }}-${{ inputs.version }}
1313
output-directory:
1414
description: Directory for the release artifacts.
1515
default: release
1616
release-notes:
1717
description: Path to the release notes.
1818
default: RELEASE_NOTES.md
19-
token:
20-
description: >-
21-
GitHub token to author release
22-
(`contents: write` for fine-grained PAT; `repo` for classic PAT).
19+
release-token:
20+
description: 'GitHub token to create the release. Fine-grained PAT: `contents: write`'
2321
default: ${{ github.token }}
2422
runs:
2523
using: composite
@@ -66,7 +64,7 @@ runs:
6664
- name: Create Release
6765
shell: bash
6866
env:
69-
GH_TOKEN: ${{ input.token }}
67+
GH_TOKEN: ${{ input.release-token }}
7068
run: >
7169
gh release create
7270
--notes-file "${{ inputs.output-directory }}/${{ inputs.release-notes }}"

0 commit comments

Comments
 (0)