Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/86 make token configurable via new secret GITHUB_USER_TOKEN #87

Merged
merged 22 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
90d0ba5
feat: make token configurable in release process
luislard Nov 2, 2023
250c051
chore: change the name of the variable used in the workflow
luislard Nov 2, 2023
10cb508
chore: remove default since it is not supported
luislard Nov 2, 2023
f87bcfa
chore: test simple config
luislard Nov 2, 2023
0ddf078
chore: not persisting credentials on checkout
luislard Nov 2, 2023
cb208b4
fix: adding missing github dependency
luislard Nov 2, 2023
4b6d78c
chore: add defaults again
luislard Nov 2, 2023
f65f05e
chore: setting to false
luislard Nov 2, 2023
5c8c875
chore: making token mandatory
luislard Nov 2, 2023
ebd2238
chore: default to the github token
luislard Nov 3, 2023
5a29c53
chore: test removing github plugin
luislard Nov 3, 2023
ef4a166
chore: testing removing the persist credentials
luislard Nov 3, 2023
cac64b3
chore: returning back persist creds as it is needed
luislard Nov 3, 2023
5e54941
docs: hide underlaying implementation
luislard Nov 8, 2023
a5bac94
docs: adding documentation regarding the USER_TOKEN secret configuration
luislard Nov 8, 2023
93a984a
docs: Update docs/automatic-release.md
luislard Nov 8, 2023
b66b29c
chore: Update .github/workflows/automatic-release.yml
luislard Nov 8, 2023
3dc117f
docs: better default value
luislard Nov 8, 2023
95191ab
chore: align name of variable
luislard Nov 14, 2023
1e4a4f3
chore: fix table format, enhanced some texts
luislard Nov 14, 2023
cbaea98
Apply suggestions from code review
Chrico Nov 28, 2023
746b0bf
Merge branch 'main' into feat/86_make_token_configurable
Chrico Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
USER_TOKEN:
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved
description: Authentication token with write permission needed by the release bot.
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved
required: false

jobs:
release:
Expand All @@ -31,6 +35,8 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved

- 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.USER_TOKEN != '' && secrets.USER_TOKEN || secrets.GITHUB_TOKEN }}
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -40,9 +40,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 |
| `USER_TOKEN` | false |'' | Authentication token with write permission needed by the release bot. When not defined will fallback to GITHUB_TOKEN |
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved

**Example with configuration parameters:**

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