Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

---

Expand All @@ -54,6 +55,7 @@ jobs:
- uses: PandasWhoCode/update-custom-properties@v1
with:
token: ${{ secrets.GH_CUSTOM_PROPERTIES_TOKEN }}
sleep-length: '5'
```

---
Expand Down
6 changes: 6 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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!"