Skip to content

Commit

Permalink
feat(GitHub Action): Make the github_token input optional (#2)
Browse files Browse the repository at this point in the history
...by defaulting it to `github.token`.

Co-authored-by: bjoluc <[email protected]>
  • Loading branch information
miigotu and bjoluc authored Oct 4, 2022
1 parent 5c724a4 commit 6337108
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ inputs:
description: "An API token for the PyPI repository specified by `pypi_repository`"
required: true
github_token:
description: "A GitHub API token (to publish GitHub releases and comment on resolved issues)"
required: true
description: "A GitHub API token to publish GitHub releases and comment on resolved issues"
default: ${{ github.token }}
required: false

pypi_repository:
description: "The repository to upload your Python package to (e.g., `https://upload.pypi.org/legacy/` for PyPI, or `https://test.pypi.org/legacy/` for Test PyPI)"
Expand Down
9 changes: 4 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ A shareable semantic-release configuration and composite GitHub Action for Pytho
- uses: bjoluc/semantic-release-config-poetry@v2
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
```
- If you are not using GitHub Actions, configure a release job in your CI like this:
Expand All @@ -49,10 +48,10 @@ A shareable semantic-release configuration and composite GitHub Action for Pytho
The shareable semantic-release configuration exposed by this package requires the following environment variables.
When using the GitHub action, each environment variable can be set via its corresponding lower-case input variable (e.g., `pypi_token` for `PYPI_TOKEN`).

| Environment variable | Description |
| -------------------- | ------------------------------------------------------------------------------ |
| `PYPI_TOKEN` | An API token for the PyPI repository specified by `PYPI_REPOSITORY` |
| `GITHUB_TOKEN` | A GitHub API token (to publish GitHub releases and comment on resolved issues) |
| Environment variable | Description |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PYPI_TOKEN` | An API token for the PyPI repository specified by `PYPI_REPOSITORY` |
| `GITHUB_TOKEN` | A GitHub API token to publish GitHub releases and comment on resolved issues. The `github_token` Action input is optional and defaults to the value of the `GITHUB_TOKEN` secret. |

Furthermore, the following optional environment variables can be set:

Expand Down

0 comments on commit 6337108

Please sign in to comment.