Skip to content

Commit

Permalink
Feat/86 make token configurable via new secret GITHUB_USER_TOKEN (#87)
Browse files Browse the repository at this point in the history
* feat: make token configurable in release process
Closes #86

* chore: change the name of the variable used in the workflow

* chore: remove default since it is not supported

* chore: test simple config

* chore: not persisting credentials on checkout

* fix: adding missing github dependency

* chore: add defaults again

* chore: setting to false

* chore: making token mandatory

* chore: default to the github token

* chore: test removing github plugin

* chore: testing removing the persist credentials

* chore: returning back persist creds as it is needed

* docs: hide underlaying implementation

* docs: adding documentation regarding the USER_TOKEN secret configuration

* docs: Update docs/automatic-release.md

Co-authored-by: Philipp Bammes <[email protected]>
Signed-off-by: Luis Rosales <[email protected]>

* chore: Update .github/workflows/automatic-release.yml

Co-authored-by: Erika Gili <[email protected]>
Signed-off-by: Luis Rosales <[email protected]>

* docs: better default value

* chore: align name of variable

* chore: fix table format, enhanced some texts

* Apply suggestions from code review

Co-authored-by: Philipp Bammes <[email protected]>
Signed-off-by: Christian Leucht <[email protected]>

---------

Signed-off-by: Luis Rosales <[email protected]>
Signed-off-by: Christian Leucht <[email protected]>
Co-authored-by: Philipp Bammes <[email protected]>
Co-authored-by: Erika Gili <[email protected]>
Co-authored-by: Christian Leucht <[email protected]>
  • Loading branch information
4 people authored Nov 28, 2023
1 parent 20e66aa commit 7efcca8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/automatic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
default: 18
required: false
type: string
secrets:
GITHUB_USER_TOKEN:
description: Authentication token with write permission needed by the release bot (falls back to GITHUB_TOKEN).
required: false

jobs:
release:
Expand All @@ -31,6 +35,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Check presence of release.config.js
run: |
Expand All @@ -57,5 +63,5 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_USER_TOKEN != '' && secrets.GITHUB_USER_TOKEN || secrets.GITHUB_TOKEN }}
run: npx semantic-release
9 changes: 6 additions & 3 deletions docs/automatic-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ jobs:
#### Inputs
| Name | Default | Description |
|----------------|---------|------------------------------------------------------|
| `NODE_VERSION` | 18 | Node version with which the release will be executed |
| Name | Required | Default | Description |
|---------------------|----------|---------|---------------------------------------------------------------------------------------------------|
| `NODE_VERSION` | false |18 | Node version with which the release will be executed |
| `GITHUB_USER_TOKEN` | false |`''` | Authentication token with write permission needed by the release bot (falls back to GITHUB_TOKEN) |

**Example with configuration parameters:**

Expand All @@ -62,4 +63,6 @@ jobs:
uses: inpsyde/reusable-workflows/.github/workflows/automatic-release.yml@main
with:
NODE_VERSION: 16
secrets:
GITHUB_USER_TOKEN: ${{ secrets.WRITE_TOKEN }}
```

0 comments on commit 7efcca8

Please sign in to comment.