Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
feat(release-please): add default token input option (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-Xu-0100 committed Feb 16, 2021
1 parent 55f1c58 commit eea7db7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
40 changes: 17 additions & 23 deletions README.md
Expand Up @@ -10,7 +10,7 @@ Automate releases with Conventional Commit Messages.
repository (_this is where your actions will live_).
2. Now create a `.github/workflows/release-please.yml` file with these contents:

```yaml
```yaml
on:
push:
branches:
Expand All @@ -22,7 +22,6 @@ Automate releases with Conventional Commit Messages.
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: release-please-action
```
Expand All @@ -36,15 +35,15 @@ Automate releases with Conventional Commit Messages.

| input | description |
|:---:|---|
| `token` | A GitHub secret token, you will most likely want to use the special `secrets.GITHUB_TOKEN` |
| `token` | A GitHub secret token, the action defaults to using the special `secrets.GITHUB_TOKEN` |
| `release-type` | What type of project is this a release for? Reference [Release types supported](#release-types-supported); new types of releases can be [added here](https://github.com/googleapis/release-please/tree/master/src/releasers) |
| `package-name` | A name for the artifact releases are being created for (this might be the `name` field in a `setup.py` or `package.json`) |
| `bump-minor-pre-major` | Should breaking changes before 1.0.0 produce minor bumps? Default `No` |
| `path` | create a release from a path other than the repository's root |
| `monorepo-tags` | add prefix to tags and branches, allowing multiple libraries to be released from the same repository. |
| `changelog-types` | A JSON formatted String containing to override the outputted changelog sections |
| `version-file` | provide a path to a version file to increment (used by ruby releaser) |
| `fork` | Should the PR be created from a fork (does not work with `secrets.GITHUB_TOKEN`) |
| `fork` | Should the PR be created from a fork. Default `false`|
| `command` | release-please command to run, either `github-release`, or `release-pr` (_defaults to running both_) |
| `default-branch` | branch to open pull release PR against (detected by default) |

Expand All @@ -60,7 +59,6 @@ Automate releases with Conventional Commit Messages.
| `sha` | sha that a GitHub release was tagged at |
| `pr` | The PR number of an opened release (undefined if no release created) |


### Release types supported

Release Please automates releases for the following flavors of repositories:
Expand Down Expand Up @@ -109,21 +107,20 @@ The most important prefixes you should have in mind are:
To output more commit information in the changelog, a JSON formatted String can be added to the Action using the `changelog-types` input parameter. This could look something like this:

```yaml
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: release-please-action
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
with:
release-type: node
package-name: release-please-action
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
```

## Automating publication to npm
Expand All @@ -144,7 +141,6 @@ jobs:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: test-release-please
# The logic below handles the npm publication:
Expand All @@ -168,7 +164,6 @@ jobs:
> So that you can keep 2FA enabled for npm publications, we recommend setting
`registry-url` to your own [Wombat Dressing Room](https://github.com/GoogleCloudPlatform/wombat-dressing-room) deployment.


## Creating major/minor tags

If you are using release-please to publish a GitHub action, you will
Expand All @@ -194,7 +189,6 @@ jobs:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: ${{env.ACTION_NAME}}
command: github-release
Expand Down
5 changes: 3 additions & 2 deletions action.yml
Expand Up @@ -3,8 +3,9 @@ description: 'automated releases based on conventional commits'
author: Google LLC
inputs:
token:
description: 'GitHub token for creating and grooming release PRs, e.g., secrets.GITHUB_TOKEN'
required: true
description: 'GitHub token for creating and grooming release PRs, defaults to using secrets.GITHUB_TOKEN'
required: false
default: ${{ github.token }}
fork:
description: 'should the PR be proposed from a fork (does not work with secrets.GITHUB_TOKEN)'
required: false
Expand Down

0 comments on commit eea7db7

Please sign in to comment.