Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Dec 11, 2024
1 parent 660a02b commit cc6ff1d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
24 changes: 15 additions & 9 deletions prepare-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
This action prepares a release on GitHub:
1. Running `towncrier` to update the changelog.

## GitHub Action Usage
## Action Inputs

| Name | Description | Default |
| ---- | ----------- | ------- |
| `version` | The version to release. | **Required** |
| `branch` | The target branch to use for the release. | `main` |
| `changelog-author` | Git-format author to use for the changelog commits. | @conda-bot |
| `fork-token` | GitHub token to create and push to the fork. If not provided, no fork will be used.<br>Fine-grained PAT: `administration: write` | `${{ github.token }}` |
| `branch-token` | GitHub token to create and push to the branch.<br>Fine-grained PAT: `contents: write` | `${{ github.token }}` |
| `pr-token` | GitHub token to create the pull request.<br>Fine-grained PAT: `pull-request: write` | `${{ github.token }}` |

## Sample Workflows

### Basic Workflow

```yaml
name: Prepare Release
Expand All @@ -26,17 +39,10 @@ jobs:
- name: Prepare Release
uses: conda/actions/prepare-release
with:
# [required]
# the version to be released
version: ${{ inputs.version }}

# [optional]
# GitHub token to fork repository and create changelog PR
# (`contents: write` & `pull-request: write` for fine-grained PAT; `repo` for classic PAT)
# token: ${{ github.token }}
```
### Sample Workflow Preparing Release using Dynamic Branch
### Dynamic Branch Workflow
```yaml
name: Prepare Release
Expand Down
18 changes: 9 additions & 9 deletions prepare-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ name: Prepare Release
description: Prepares a release by running towncrier and creating a PR with the changes.
inputs:
version:
description: Release version.
description: The version to release.
required: true
branch:
description: Target branch for the release. Unless specified, uses the default branch.
changelog_author:
description: Git-format author/committer to use for pull request commits
description: The target branch to use for the release.
changelog-author:
description: Git-format author to use for the changelog commits.
default: Conda Bot <[email protected]>
fork-token:
description: 'GitHub token to fork repository (`???: write`).'
description: 'GitHub token to create and push to the fork. Fine-grained PAT: `administration: write`'
default: ${{ github.token }}
branch-token:
description: 'GitHub token to checkout and create the release branch (`contents: write`).'
description: 'GitHub token to create and push to the branch. Fine-grained PAT: `contents: write`'
default: ${{ github.token }}
pr-token:
description: 'GitHub token to create the changelog PR (`pull-request: write`).'
description: 'GitHub token to create the pull request. Fine-grained PAT: `pull-request: write`'
default: ${{ github.token }}
runs:
using: composite
Expand Down Expand Up @@ -80,8 +80,8 @@ runs:
base: ${{ inputs.branch }}
delete-branch: true
commit-message: Changelog ${{ inputs.version }}
author: ${{ inputs.changelog_author }}
committer: ${{ inputs.changelog_author }}
author: ${{ inputs.changelog-author }}
committer: ${{ inputs.changelog-author }}
title: Changelog ${{ inputs.version }}
body: |
[release.yml]: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/release.yml
Expand Down

0 comments on commit cc6ff1d

Please sign in to comment.