From 90d0ba5046b9baf977240e0d8ea23055cbd1fbd6 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 17:37:22 +0100 Subject: [PATCH 01/21] feat: make token configurable in release process Closes #86 --- .github/workflows/automatic-release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 28655121..67cdc5d0 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -7,6 +7,10 @@ on: default: 18 required: false type: string + secrets: + GITHUB_TOKEN: + description: Authentication for the semantic release action. + required: false jobs: release: From 250c0516e075bc3af755bd271b02d3a098729d35 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 17:44:39 +0100 Subject: [PATCH 02/21] chore: change the name of the variable used in the workflow --- .github/workflows/automatic-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 67cdc5d0..906bd408 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -8,9 +8,10 @@ on: required: false type: string secrets: - GITHUB_TOKEN: + USER_TOKEN: description: Authentication for the semantic release action. required: false + default: ${{ secrets.GITHUB_TOKEN }} jobs: release: @@ -61,5 +62,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} run: npx semantic-release From 10cb508d568208931c5886462021159bd65030ce Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 17:56:28 +0100 Subject: [PATCH 03/21] chore: remove default since it is not supported --- .github/workflows/automatic-release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 906bd408..f4cc9166 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -11,7 +11,6 @@ on: USER_TOKEN: description: Authentication for the semantic release action. required: false - default: ${{ secrets.GITHUB_TOKEN }} jobs: release: @@ -62,5 +61,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.USER_TOKEN != '' && secrets.USER_TOKEN || secrets.GITHUB_TOKEN }} run: npx semantic-release From f87bcfa19b94c944d3b28893411f2c276ab8ca74 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 18:00:39 +0100 Subject: [PATCH 04/21] chore: test simple config --- .github/workflows/automatic-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index f4cc9166..61ed356c 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -61,5 +61,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.USER_TOKEN != '' && secrets.USER_TOKEN || secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} run: npx semantic-release From 0ddf07899a6848b8e9d94297c336f92d84931ee5 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 18:18:49 +0100 Subject: [PATCH 05/21] chore: not persisting credentials on checkout --- .github/workflows/automatic-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 61ed356c..600eaeeb 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -35,6 +35,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false - name: Check presence of release.config.js run: | From cb208b4ed9a014fa14154321c7e6aa65f6c69b55 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 18:53:43 +0100 Subject: [PATCH 06/21] fix: adding missing github dependency --- .github/workflows/automatic-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 600eaeeb..7d1187b6 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -29,6 +29,7 @@ jobs: run: | npm i -g @semantic-release/changelog \ @semantic-release/git \ + @semantic-release/github \ @semantic-release/npm \ @semantic-release/exec \ semantic-release From 4b6d78c7a224c1f9a9f9068870ae848441546422 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 19:00:36 +0100 Subject: [PATCH 07/21] chore: add defaults again --- .github/workflows/automatic-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 7d1187b6..2ee2658d 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -10,7 +10,7 @@ on: secrets: USER_TOKEN: description: Authentication for the semantic release action. - required: false + required: true jobs: release: @@ -64,5 +64,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.USER_TOKEN != secrets.USER_TOKEN && secrets.USER_TOKEN || secrets.GITHUB_TOKEN }} run: npx semantic-release From f65f05eeea42ec8b821a9f0dc77557b0814b2709 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 19:02:32 +0100 Subject: [PATCH 08/21] chore: setting to false --- .github/workflows/automatic-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 2ee2658d..2bc62a85 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -10,7 +10,7 @@ on: secrets: USER_TOKEN: description: Authentication for the semantic release action. - required: true + required: false jobs: release: From 5c8c87569eb21dd67f308c661b386a6bc6e9af1e Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Thu, 2 Nov 2023 19:03:39 +0100 Subject: [PATCH 09/21] chore: making token mandatory --- .github/workflows/automatic-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 2bc62a85..55af4c91 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -10,7 +10,7 @@ on: secrets: USER_TOKEN: description: Authentication for the semantic release action. - required: false + required: true jobs: release: @@ -64,5 +64,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.USER_TOKEN != secrets.USER_TOKEN && secrets.USER_TOKEN || secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} run: npx semantic-release From ebd223819c60eca08a40590849b52c20a934c397 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Fri, 3 Nov 2023 10:36:00 +0100 Subject: [PATCH 10/21] chore: default to the github token --- .github/workflows/automatic-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 55af4c91..4b83a6a2 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -10,7 +10,7 @@ on: secrets: USER_TOKEN: description: Authentication for the semantic release action. - required: true + required: false jobs: release: @@ -64,5 +64,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.USER_TOKEN != '' && secrets.USER_TOKEN || secrets.GITHUB_TOKEN }} run: npx semantic-release From 5a29c538be6c524e9f5ed49c5d9cd4b262b18057 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Fri, 3 Nov 2023 10:59:40 +0100 Subject: [PATCH 11/21] chore: test removing github plugin --- .github/workflows/automatic-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 4b83a6a2..d9abd787 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -29,7 +29,6 @@ jobs: run: | npm i -g @semantic-release/changelog \ @semantic-release/git \ - @semantic-release/github \ @semantic-release/npm \ @semantic-release/exec \ semantic-release From ef4a166c218b08cb7891138bd1f16e1fad04d371 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Fri, 3 Nov 2023 11:32:09 +0100 Subject: [PATCH 12/21] chore: testing removing the persist credentials --- .github/workflows/automatic-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index d9abd787..f4cc9166 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -35,8 +35,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - with: - persist-credentials: false - name: Check presence of release.config.js run: | From cac64b3b87b899d14d358663a45381349c978fdb Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Fri, 3 Nov 2023 11:36:50 +0100 Subject: [PATCH 13/21] chore: returning back persist creds as it is needed --- .github/workflows/automatic-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index f4cc9166..d9abd787 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -35,6 +35,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false - name: Check presence of release.config.js run: | From 5e549411d2ec3418076b2c1f08c4917c9aa65c56 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Wed, 8 Nov 2023 09:42:02 +0100 Subject: [PATCH 14/21] docs: hide underlaying implementation --- .github/workflows/automatic-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index d9abd787..195c7a3f 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -9,7 +9,7 @@ on: type: string secrets: USER_TOKEN: - description: Authentication for the semantic release action. + description: Authentication for the automatic release action. required: false jobs: From a5bac945391a7770bc03e2dc446dd10c15ab13b8 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Wed, 8 Nov 2023 09:52:34 +0100 Subject: [PATCH 15/21] docs: adding documentation regarding the USER_TOKEN secret configuration --- docs/automatic-release.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/automatic-release.md b/docs/automatic-release.md index a4592162..73792106 100644 --- a/docs/automatic-release.md +++ b/docs/automatic-release.md @@ -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 |`empty` | The token used to authenticate with GitHub. When not defined will fallback to GITHUB_TOKEN | **Example with configuration parameters:** @@ -58,4 +59,6 @@ jobs: uses: inpsyde/reusable-workflows/.github/workflows/automatic-release.yml@main with: NODE_VERSION: 16 + secrets: + USER_TOKEN: ${{ secrets.MY_TOKEN_SECRET }} ``` From 93a984a107cd6ac1bc8ad0fbf07e11373460a5f6 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Wed, 8 Nov 2023 14:54:28 +0100 Subject: [PATCH 16/21] docs: Update docs/automatic-release.md Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Luis Rosales --- docs/automatic-release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/automatic-release.md b/docs/automatic-release.md index 73792106..323cf6a5 100644 --- a/docs/automatic-release.md +++ b/docs/automatic-release.md @@ -60,5 +60,5 @@ jobs: with: NODE_VERSION: 16 secrets: - USER_TOKEN: ${{ secrets.MY_TOKEN_SECRET }} + USER_TOKEN: ${{ secrets.WRITE_TOKEN }} ``` From b66b29cca5817748aada0e87b6c1e6a02aa32f51 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Wed, 8 Nov 2023 14:54:59 +0100 Subject: [PATCH 17/21] chore: Update .github/workflows/automatic-release.yml Co-authored-by: Erika Gili Signed-off-by: Luis Rosales --- .github/workflows/automatic-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 195c7a3f..81353bc8 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -9,7 +9,7 @@ on: type: string secrets: USER_TOKEN: - description: Authentication for the automatic release action. + description: Authentication token with write permission needed by the release bot. required: false jobs: From 3dc117f0b0c5143e38989be7abcb6c0fdc3cdae1 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Wed, 8 Nov 2023 15:20:00 +0100 Subject: [PATCH 18/21] docs: better default value --- docs/automatic-release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/automatic-release.md b/docs/automatic-release.md index 323cf6a5..01799d2d 100644 --- a/docs/automatic-release.md +++ b/docs/automatic-release.md @@ -43,7 +43,7 @@ jobs: | Name | Required | Default | Description | |----------------|----------|------------------|--------------------------------------------------------------------------------------------| | `NODE_VERSION` | false |18 | Node version with which the release will be executed | -| `USER_TOKEN` | false |`empty` | The token used to authenticate with GitHub. When not defined will fallback to GITHUB_TOKEN | +| `USER_TOKEN` | false |'' | Authentication token with write permission needed by the release bot. When not defined will fallback to GITHUB_TOKEN | **Example with configuration parameters:** From 95191abf3407cf0c56689ba5232a766ac5bea1ef Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Tue, 14 Nov 2023 11:37:16 +0100 Subject: [PATCH 19/21] chore: align name of variable --- .github/workflows/automatic-release.yml | 4 ++-- docs/automatic-release.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 81353bc8..6aa21113 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -8,7 +8,7 @@ on: required: false type: string secrets: - USER_TOKEN: + GITHUB_USER_TOKEN: description: Authentication token with write permission needed by the release bot. required: false @@ -63,5 +63,5 @@ jobs: - name: Release env: - GITHUB_TOKEN: ${{ secrets.USER_TOKEN != '' && secrets.USER_TOKEN || secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_USER_TOKEN != '' && secrets.GITHUB_USER_TOKEN || secrets.GITHUB_TOKEN }} run: npx semantic-release diff --git a/docs/automatic-release.md b/docs/automatic-release.md index 01799d2d..d25bb42c 100644 --- a/docs/automatic-release.md +++ b/docs/automatic-release.md @@ -40,10 +40,10 @@ jobs: #### Inputs -| 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 | +| 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. When not defined will fallback to GITHUB_TOKEN | **Example with configuration parameters:** @@ -60,5 +60,5 @@ jobs: with: NODE_VERSION: 16 secrets: - USER_TOKEN: ${{ secrets.WRITE_TOKEN }} + GITHUB_USER_TOKEN: ${{ secrets.WRITE_TOKEN }} ``` From 1e4a4f3452cece8894b70936403a164896d653b2 Mon Sep 17 00:00:00 2001 From: Luis Rosales Date: Tue, 14 Nov 2023 11:45:11 +0100 Subject: [PATCH 20/21] chore: fix table format, enhanced some texts --- .github/workflows/automatic-release.yml | 2 +- docs/automatic-release.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/automatic-release.yml b/.github/workflows/automatic-release.yml index 6aa21113..ad69e758 100644 --- a/.github/workflows/automatic-release.yml +++ b/.github/workflows/automatic-release.yml @@ -9,7 +9,7 @@ on: type: string secrets: GITHUB_USER_TOKEN: - description: Authentication token with write permission needed by the release bot. + description: Authentication token with write permission needed by the release bot (falls back to GITHUB_TOKEN). required: false jobs: diff --git a/docs/automatic-release.md b/docs/automatic-release.md index d25bb42c..47399fb2 100644 --- a/docs/automatic-release.md +++ b/docs/automatic-release.md @@ -40,10 +40,10 @@ jobs: #### Inputs -| 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. When not defined will fallback to GITHUB_TOKEN | +| 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:** From cbaea98974783b4b3838072da7988cccd348220d Mon Sep 17 00:00:00 2001 From: Christian Leucht <3417446+Chrico@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:34:31 +0100 Subject: [PATCH 21/21] Apply suggestions from code review Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Christian Leucht <3417446+Chrico@users.noreply.github.com> --- docs/automatic-release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/automatic-release.md b/docs/automatic-release.md index 47399fb2..a658aa4c 100644 --- a/docs/automatic-release.md +++ b/docs/automatic-release.md @@ -43,7 +43,7 @@ jobs: | 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) | +| `GITHUB_USER_TOKEN` | false |`''` | Authentication token with write permission needed by the release bot (falls back to GITHUB_TOKEN) | **Example with configuration parameters:**