From ee0a6310d57a5f74b3f97b34644059fcb95c271f Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 1 May 2025 07:52:13 +0200 Subject: [PATCH 1/7] add PAT, fix rate limit Signed-off-by: Martijn Govers --- action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b433b70..41fef24 100644 --- a/action.yml +++ b/action.yml @@ -4,15 +4,22 @@ name: Bump Version description: Retrieve the latest release tag, run the Bash script to bump version, and save the new version to PYPI_VERSION. + +inputs: # actions don't have secrets, so we use inputs instead + token: + description: 'A Github PAT, e.g. `${{ secrets.GITHUB_TOKEN }}`' + required: true + runs: using: "composite" steps: - name: Get Latest Release Tag id: fetch_tag - uses: pozetroninc/github-action-get-latest-release@master + uses: pozetroninc/github-action-get-latest-release@v0.8.0 with: repository: ${{ github.repository }} excludes: prerelease, draft + token: ${{ ::add-mask::inputs.token }} - name: Run version bump script id: bump_version From ec5a04f034f74d311b1986e171b0dd3070544f31 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 1 May 2025 08:13:32 +0200 Subject: [PATCH 2/7] actually test the current version of the action + add tokens Signed-off-by: Martijn Govers --- .github/workflows/test-action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 33aeeee..06a27b9 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -29,4 +29,6 @@ jobs: python-version: "3.12" - name: Set PyPI Version - uses: PowerGridModel/pgm-version-bump@main + uses: PowerGridModel/pgm-version-bump@${{ github.sha }} + with: + token: ${{ secrets.GITHUB_TOKEN }} From f4e61840e1ec48eac0ac9d5bff9a6f3228a0fafa Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 1 May 2025 08:52:40 +0200 Subject: [PATCH 3/7] version Signed-off-by: Martijn Govers --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ba66466..49d5957 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0 +0.1 From 9f03292e4c724933fce27b285df74bbda61cdcc5 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 1 May 2025 08:59:39 +0200 Subject: [PATCH 4/7] mask is illegal code Signed-off-by: Martijn Govers --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 41fef24..4aa9ad6 100644 --- a/action.yml +++ b/action.yml @@ -19,7 +19,7 @@ runs: with: repository: ${{ github.repository }} excludes: prerelease, draft - token: ${{ ::add-mask::inputs.token }} + token: ${{ inputs.token }} - name: Run version bump script id: bump_version From 49af1a9b161cddd6130f53e10ecfdf0a14982546 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 1 May 2025 09:01:45 +0200 Subject: [PATCH 5/7] fix typo Signed-off-by: Martijn Govers --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4aa9ad6..8f18ed7 100644 --- a/action.yml +++ b/action.yml @@ -7,7 +7,7 @@ description: Retrieve the latest release tag, run the Bash script to bump versio inputs: # actions don't have secrets, so we use inputs instead token: - description: 'A Github PAT, e.g. `${{ secrets.GITHUB_TOKEN }}`' + description: 'A Github PAT, e.g. secrets.GITHUB_TOKEN' required: true runs: From a5817013133a9b4435bf31d71f01684e595eefff Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 1 May 2025 09:04:52 +0200 Subject: [PATCH 6/7] apparently, required inputs are not required... Signed-off-by: Martijn Govers --- action.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 8f18ed7..5619c85 100644 --- a/action.yml +++ b/action.yml @@ -5,10 +5,9 @@ name: Bump Version description: Retrieve the latest release tag, run the Bash script to bump version, and save the new version to PYPI_VERSION. -inputs: # actions don't have secrets, so we use inputs instead +inputs: # actions don't have secrets, so we use inputs instead token: - description: 'A Github PAT, e.g. secrets.GITHUB_TOKEN' - required: true + description: "A Github PAT, e.g. secrets.GITHUB_TOKEN. When not provided, the action will use the default token (may hit rate limits)." runs: using: "composite" @@ -20,7 +19,7 @@ runs: repository: ${{ github.repository }} excludes: prerelease, draft token: ${{ inputs.token }} - + - name: Run version bump script id: bump_version shell: bash From 5720e37c69291e36b827032793913737e47f6cd6 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Thu, 1 May 2025 09:06:06 +0200 Subject: [PATCH 7/7] use github actions token Signed-off-by: Martijn Govers --- .github/workflows/test-action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 0a8cc05..814c869 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -26,6 +26,8 @@ jobs: - name: Set PyPI Version uses: ./ + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Show latest version run: cat PYPI_VERSION