{"id":20563207,"url":"https://github.com/nexthink-oss/ghup","last_synced_at":"2025-04-14T14:42:46.526Z","repository":{"id":63488585,"uuid":"564868569","full_name":"nexthink-oss/ghup","owner":"nexthink-oss","description":"A tool for managing GitHub repository tags and content from third-party automation systems","archived":false,"fork":false,"pushed_at":"2025-04-12T09:51:31.000Z","size":300,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-12T10:38:16.912Z","etag":null,"topics":["git-commit","git-tag","github-api","github-token"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nexthink-oss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-11T17:35:39.000Z","updated_at":"2025-04-12T09:51:34.000Z","dependencies_parsed_at":"2022-11-19T22:46:59.062Z","dependency_job_id":"55807128-d5a7-4137-a0b6-824dd47f37cb","html_url":"https://github.com/nexthink-oss/ghup","commit_stats":{"total_commits":68,"total_committers":2,"mean_commits":34.0,"dds":0.5,"last_synced_commit":"e8563d29b3b995723a2a936f1753e84c6947a51f"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexthink-oss%2Fghup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexthink-oss%2Fghup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexthink-oss%2Fghup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexthink-oss%2Fghup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexthink-oss","download_url":"https://codeload.github.com/nexthink-oss/ghup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248898641,"owners_count":21179809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git-commit","git-tag","github-api","github-token"],"created_at":"2024-11-16T04:16:56.186Z","updated_at":"2025-04-14T14:42:46.520Z","avatar_url":"https://github.com/nexthink-oss.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CodeQL](https://github.com/nexthink-oss/ghup/actions/workflows/codeql.yml/badge.svg)](https://github.com/nexthink-oss/ghup/actions/workflows/codeql.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nexthink-oss/ghup)](https://goreportcard.com/report/github.com/nexthink-oss/ghup)\n\n# ghup\n\n`ghup` is a command-line tool for managing GitHub repository content and refs (branches and tags) directly via the GitHub API, with a focus on enabling verified commits from build systems such as GitHub Actions or Jenkins.\n\n## Key Features\n\n- Create, update, and delete repository content with verified commits via GitHub API\n- Create and update both lightweight and annotated tags\n- Synchronise arbitrary git refs, including fast-forward merges\n- Resolve commit references to full SHAs\n- Open pull requests for changes\n- Smart context detection for repository and branch information\n- 12-Factor app style configuration via flags, environment variables, or files\n- No external dependencies required\n\n## Requirements\n\n- A GitHub token with `contents=write` and `metadata=read` permissions (plus `workflows=write` if managing GitHub workflows)\n- For verified commits, use a token derived from GitHub App credentials\n\n## Installation\n\n### Pre-built Binaries\n\nDownload binaries for all platforms from [GitHub Releases](https://github.com/nexthink-oss/ghup/releases/latest).\n\n### Using Go\n\n```sh\ngo install github.com/nexthink-oss/ghup@latest\n```\n\n### Homebrew\n\n```sh\nbrew install isometry/tap/ghup\n```\n\n### GitHub Actions\n\n```yaml\n- uses: nexthink-oss/ghup/actions/setup@v1\n```\n\n## Configuration\n\n`ghup` can be configured through:\n\n1. Command-line flags\n2. Environment variables (`GHUP_*`, with various fallbacks for CI tools)\n3. Configuration files (various formats supported)\n\nWhen run from a git repository, `ghup` automatically detects:\n- Repository owner and name from the GitHub remote\n- Current branch\n- Git user information for commit trailers\n\nSee [full documentation](docs/cmd/ghup.md) for details on configuration options.\n\n## Basic Usage\n\n### Managing Content\n\n```sh\n# Update a file\nghup content -b feature-branch -u local/file.txt:remote/path.txt\n\n# Create a pull request with changes\nghup content -b new-feature -u config.json --pr-title \"Update configuration\"\n\n# Add, update, and delete files in one commit\nghup content -b updates \\\n  -u local/new-file.txt:new-file.txt \\\n  -d old-file.txt \\\n  -c main:existing-file.txt:new-location.txt\n```\n\nSee [content command documentation](docs/cmd/ghup_content.md) for more examples.\n\n### Creating and Managing Tags\n\n```sh\n# Create an annotated tag\nghup tag v1.0.0 --commitish main\n\n# Create a lightweight tag\nghup tag v1.0.0 --lightweight\n```\n\nSee [tag command documentation](docs/cmd/ghup_tag.md) for more examples.\n\n### Updating References\n\n```sh\n# Fast-forward a branch to match another\nghup update-ref -s main refs/heads/production\n\n# Update GitHub Actions-style tags after a release\nghup update-ref -s tags/v1.2.3 tags/v1.2 tags/v1\n```\n\nSee [update-ref command documentation](docs/cmd/ghup_update-ref.md) for more examples.\n\n### Resolving Commits\n\n```sh\n# Resolve a branch to its SHA\nghup resolve main\n\n# Find all tags pointing to a specific commit\nghup resolve abc123 --tags\n```\n\nSee [resolve command documentation](docs/cmd/ghup_resolve.md) for more examples.\n\n### Debugging\n\n```sh\n# View configuration and environment information\nghup debug\n```\n\nSee [debug command documentation](docs/cmd/ghup_debug.md) for more details.\n\n## GitHub Actions\n\n`ghup` offers ready-to-use GitHub Actions to simplify integration within your workflows:\n\n### Setup Action\n\nThe [`nexthink-oss/ghup/actions/setup`](actions/setup/README.md) action installs `ghup` and makes it available in your workflow:\n\n```yaml\n- uses: nexthink-oss/ghup/actions/setup@main\n  with:\n    version: v0.12.0 # optional, defaults to 'latest'\n```\n\n### Fast-Forward Action\n\nThe [`nexthink-oss/ghup/actions/fast-forward`](actions/fast-forward/README.md) action updates refs to match a source commit:\n\n```yaml\n- uses: nexthink-oss/ghup/actions/fast-forward@main\n  with:\n    source: main\n    target: refs/heads/production\n    # force: false # optional, defaults to false\n  env:\n    GITHUB_TOKEN: ${{ github.token }}\n```\n\nUse this action to implement true fast-forward merges or to create/update tags from specific commits.\n\nSee individual action READMEs for detailed usage examples and parameters.\n\n## Documentation\n\nDetailed documentation for all commands is available in the [docs/cmd](docs/cmd) directory:\n\n- [`ghup`](docs/cmd/ghup.md): General command usage and configuration\n- [`ghup content`](docs/cmd/ghup_content.md): Managing repository content\n- [`ghup tag`](docs/cmd/ghup_tag.md): Creating and managing tags\n- [`ghup update-ref`](docs/cmd/ghup_update-ref.md): Updating git refs\n- [`ghup resolve`](docs/cmd/ghup_resolve.md): Resolving commit-ish references\n- [`ghup debug`](docs/cmd/ghup_debug.md): Debugging configuration and environment\n\n## Contributing\n\nAll contributions in the spirit of the project are welcome! Open an issue or pull request to get started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexthink-oss%2Fghup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexthink-oss%2Fghup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexthink-oss%2Fghup/lists"}