diff --git a/README.md b/README.md index 0167e64..d31d2eb 100644 --- a/README.md +++ b/README.md @@ -36,9 +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` | +|------------------------|-------------------------------------------------------------------------------------------------------|-------|------------------------| +| `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` --- @@ -54,6 +55,7 @@ jobs: - uses: PandasWhoCode/update-custom-properties@v1 with: token: ${{ secrets.GH_CUSTOM_PROPERTIES_TOKEN }} + sleep-length: '5' ``` --- diff --git a/action.yaml b/action.yaml index b942df5..64e7a0a 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: '0' 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!"