From 18d6f21d6dae5ccb3ddc89289b9cf8061bb7984a Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 24 Oct 2025 19:36:51 +0300 Subject: [PATCH] doc: mention that the script works for organizations too --- README.md | 20 ++++++++++++++------ flake.nix | 24 ++++++++++++++++-------- github2forgejo | 20 ++++++++++++++------ 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 11bea53..3df45a5 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,24 @@ Plain simple, just install [Nushell](https://nushell.sh) and run the script: Help Output ``` -Migrates a GitHub users repositories to a Forgejo instance. +Migrates a GitHub users or organizations repositories to a Forgejo instance. Accepted environment variables: - GITHUB_USER: The user to fetch the repositories from. Case sensitive. - GITHUB_TOKEN: An access token for fetching private repositories. Optional. + GITHUB_USER: + The user or organization to fetch the repositories from. + Case sensitive. + GITHUB_TOKEN: + An access token for fetching private repositories. + Optional. Set to empty string to not ask interactively. - FORGEJO_URL: The URL to the Forgejo instance. Must include the protocol (https://). - FORGEJO_USER: The user to migrate the repositories to. - FORGEJO_TOKEN: An access token for the specified user. + FORGEJO_URL: + The URL to the Forgejo instance. + Must include the protocol (http(s)://) as it is not just a domain. + FORGEJO_USER: + The user or organization to migrate the repositories to. + FORGEJO_TOKEN: + An access token for the specified user. STRATEGY: The strategy. Valid options are "mirrored" or "cloned" (case insensitive). diff --git a/flake.nix b/flake.nix index 7f8752c..3a8c247 100644 --- a/flake.nix +++ b/flake.nix @@ -43,19 +43,27 @@ You must set ALL of these environment variables: - GITHUB_USER: The user to fetch the repositories from. - GITHUB_TOKEN: An access token for fetching private repositories. Optional. - - FORGEJO_URL: The URL to the Forgejo instance. Must include the protocol (https://). - FORGEJO_USER: The user to migrate the repositories to. - FORGEJO_TOKEN: An access token for the specified user. - + GITHUB_USER: + The user or organization to fetch the repositories from. + Case sensitive. + GITHUB_TOKEN: + An access token for fetching private repositories. + Optional. Set to empty string to not ask interactively. + + FORGEJO_URL: + The URL to the Forgejo instance. + Must include the protocol (http(s)://) as it is not just a domain. + FORGEJO_USER: + The user or organization to migrate the repositories to. + FORGEJO_TOKEN: + An access token for the specified user. + STRATEGY: The strategy. Valid options are "mirrored" or "cloned" (case insensitive). "mirrored" will mirror the repository and tell the Forgejo instance to periodically update it, "cloned" will only clone once. "cloned" is useful if you are never going to use GitHub again. - + FORCE_SYNC: Whether to delete a mirrored repo from the Forgejo instance if the source on GitHub doesn't exist anymore. Must be either "true" or "false". diff --git a/github2forgejo b/github2forgejo index 71f8ade..72c8283 100755 --- a/github2forgejo +++ b/github2forgejo @@ -8,16 +8,24 @@ def or-default [default: closure] { } } -# Migrates a GitHub users repositories to a Forgejo instance. +# Migrates a GitHub users or organizations repositories to a Forgejo instance. # # Accepted environment variables: # -# GITHUB_USER: The user to fetch the repositories from. Case sensitive. -# GITHUB_TOKEN: An access token for fetching private repositories. Optional. +# GITHUB_USER: +# The user or organization to fetch the repositories from. +# Case sensitive. +# GITHUB_TOKEN: +# An access token for fetching private repositories. +# Optional. Set to empty string to not ask interactively. # -# FORGEJO_URL: The URL to the Forgejo instance. Must include the protocol (https://). -# FORGEJO_USER: The user to migrate the repositories to. -# FORGEJO_TOKEN: An access token for the specified user. +# FORGEJO_URL: +# The URL to the Forgejo instance. +# Must include the protocol (http(s)://) as it is not just a domain. +# FORGEJO_USER: +# The user or organization to migrate the repositories to. +# FORGEJO_TOKEN: +# An access token for the specified user. # # STRATEGY: # The strategy. Valid options are "mirrored" or "cloned" (case insensitive).