From 15faeef72bf5567e7421e46d1544c7e80b526130 Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 10:37:35 -0500 Subject: [PATCH 1/8] feat: add new sleep length parameter to action **Description**: This PR adds a new flag to allow for sleeping between each API call to avoid rate limiting. **Related Issue(s)**: Implements #21 Signed-off-by: Andrew Brandt --- action.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.yaml b/action.yaml index b942df5..e0ca8e3 100644 --- a/action.yaml +++ b/action.yaml @@ -10,6 +10,10 @@ inputs: token: description: 'Personal Access Token' required: true + sleep-length: + description: 'Time to sleep (sec) between API calls' + required: false + default: 1 runs: using: "composite" @@ -38,6 +42,7 @@ runs: shell: bash env: GH_TOKEN: ${{ inputs.token }} + SLEEP_LENGTH: ${{ inputs.sleep-length }} run: | # Input files REPO_NAMES_FILE="repo-names.txt" @@ -85,6 +90,7 @@ runs: fi # API Call here gh api --method PATCH -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${ORG_NAME}/${REPO_NAME}/properties/values -f "properties[][property_name]=${key}" -f "properties[][value]=${value}" + sleep "${SLEEP_LENGTH}" done done < "${REPO_NAMES_FILE}" echo "Successfully set custom properties!" From fee625d942b14dec4e5503d6f731ed8abb4937d2 Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 10:40:21 -0500 Subject: [PATCH 2/8] Update readme Signed-off-by: Andrew Brandt --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0167e64..5405c1e 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ fine-grained token with the following permissions: |------------------------|-------------------------------------------------------------------------------------------------------|----------|------------------------| | `token` | GitHub Personal Access Token (Fine-Grained with: Repository custom properties `Read and Write` scope) | ✅ Yes | — | | `repo-properties.yaml` | File should be located in the root-level directory. | ✅ Yes | `repo-properties.yaml` | +| `sleep-length` | Time (seconds) to sleep between API calls | :x: No | `1 second` --- @@ -54,6 +55,7 @@ jobs: - uses: PandasWhoCode/update-custom-properties@v1 with: token: ${{ secrets.GH_CUSTOM_PROPERTIES_TOKEN }} + sleep-length: 5 ``` --- From d9cd468749540b70255e38a30177c737fc6be694 Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 10:44:29 -0500 Subject: [PATCH 3/8] fix emoji Signed-off-by: Andrew Brandt --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5405c1e..58bd524 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,10 @@ fine-grained token with the following permissions: ## 📦 Inputs | Name | Description | Required | Default | -|------------------------|-------------------------------------------------------------------------------------------------------|----------|------------------------| -| `token` | GitHub Personal Access Token (Fine-Grained with: Repository custom properties `Read and Write` scope) | ✅ Yes | — | -| `repo-properties.yaml` | File should be located in the root-level directory. | ✅ Yes | `repo-properties.yaml` | -| `sleep-length` | Time (seconds) to sleep between API calls | :x: No | `1 second` +|------------------------|-------------------------------------------------------------------------------------------------------|-------|------------------------| +| `token` | GitHub Personal Access Token (Fine-Grained with: Repository custom properties `Read and Write` scope) | ✅ Yes | — | +| `repo-properties.yaml` | File should be located in the root-level directory. | ✅ Yes | `repo-properties.yaml` | +| `sleep-length` | Time (seconds) to sleep between API calls | ❌ No | `1 second` --- From 41b0a2c201c3886d006ba770efd1f19406e6cad5 Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 10:51:20 -0500 Subject: [PATCH 4/8] Update README.md Co-authored-by: Roger Barker Signed-off-by: Andrew Brandt --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58bd524..3560e85 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ fine-grained token with the following permissions: | Name | Description | Required | Default | |------------------------|-------------------------------------------------------------------------------------------------------|-------|------------------------| -| `token` | GitHub Personal Access Token (Fine-Grained with: Repository custom properties `Read and Write` scope) | ✅ Yes | — | -| `repo-properties.yaml` | File should be located in the root-level directory. | ✅ Yes | `repo-properties.yaml` | -| `sleep-length` | Time (seconds) to sleep between API calls | ❌ No | `1 second` +| `token` | GitHub Personal Access Token (Fine-Grained with: Repository custom properties `Read and Write` scope) | ✅ | — | +| `repo-properties.yaml` | File should be located in the root-level directory. | ✅ | `repo-properties.yaml` | +| `sleep-length` | Time (seconds) to sleep between API calls | - | `1 second` --- From 9d4695b3a66303a2bc63fcde3db179583ce14c94 Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 10:53:47 -0500 Subject: [PATCH 5/8] minor nit fix usage Signed-off-by: Andrew Brandt --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3560e85..d31d2eb 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ jobs: - uses: PandasWhoCode/update-custom-properties@v1 with: token: ${{ secrets.GH_CUSTOM_PROPERTIES_TOKEN }} - sleep-length: 5 + sleep-length: '5' ``` --- From 615a3bc7c406d3cf4831bb226ac2cbf54f15ddc9 Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 10:57:14 -0500 Subject: [PATCH 6/8] add echo out sleep Signed-off-by: Andrew Brandt --- action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yaml b/action.yaml index e0ca8e3..0788cb9 100644 --- a/action.yaml +++ b/action.yaml @@ -90,6 +90,7 @@ runs: fi # API Call here gh api --method PATCH -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${ORG_NAME}/${REPO_NAME}/properties/values -f "properties[][property_name]=${key}" -f "properties[][value]=${value}" + echo "Now sleeping for ${SLEEP_LENGTH}" sleep "${SLEEP_LENGTH}" done done < "${REPO_NAMES_FILE}" From 8f04800e2f7ae5da82d2eee794a4f77e1051952c Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 11:01:50 -0500 Subject: [PATCH 7/8] remove the echo out sleep time Signed-off-by: Andrew Brandt --- action.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 0788cb9..249586b 100644 --- a/action.yaml +++ b/action.yaml @@ -13,7 +13,7 @@ inputs: sleep-length: description: 'Time to sleep (sec) between API calls' required: false - default: 1 + default: '1' runs: using: "composite" @@ -90,7 +90,6 @@ runs: fi # API Call here gh api --method PATCH -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${ORG_NAME}/${REPO_NAME}/properties/values -f "properties[][property_name]=${key}" -f "properties[][value]=${value}" - echo "Now sleeping for ${SLEEP_LENGTH}" sleep "${SLEEP_LENGTH}" done done < "${REPO_NAMES_FILE}" From aed1205558446f8be28734524f23ab21c8e3e498 Mon Sep 17 00:00:00 2001 From: Andrew Brandt Date: Wed, 24 Sep 2025 11:04:49 -0500 Subject: [PATCH 8/8] update default value to 0 Signed-off-by: Andrew Brandt --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 249586b..64e7a0a 100644 --- a/action.yaml +++ b/action.yaml @@ -13,7 +13,7 @@ inputs: sleep-length: description: 'Time to sleep (sec) between API calls' required: false - default: '1' + default: '0' runs: using: "composite"