This script is designed to list and process repositories within a specified GitHub organization. It reads a JSON file containing keyword topics and uses the GitHub API to retrieve repository information.
- Go 1.16 or later
- A GitHub personal access token with the necessary permissions to list repositories in the organization
-
Create a JSON file containing keyword topics. The structure of the JSON file should match the expected format in the script.
-
Install dependencies
go mod tidy
-
Set up environment variables for your GitHub personal access token and the organization name:
export GITHUB_TOKEN=<personal-access-token> export GITHUB_ORG=<organization-name>
Run the script using the following command:
go run main_tagging.go
The script performs the following steps:
-
Reads and unmarshals the JSON file containing keyword topics.
-
Sets up options for listing repositories in the specified GitHub organization.
-
Retrieves all repositories from the organization, handling pagination.
-
(Commented out) Processes each repository. This section is commented out to avoid updating all repositories during testing.