{"id":13714670,"url":"https://github.com/ko-build/setup-ko","last_synced_at":"2025-04-05T09:07:53.530Z","repository":{"id":45113161,"uuid":"362126375","full_name":"ko-build/setup-ko","owner":"ko-build","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T17:21:34.000Z","size":74,"stargazers_count":45,"open_issues_count":5,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-26T01:11:06.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ko-build.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}},"created_at":"2021-04-27T13:40:52.000Z","updated_at":"2024-10-24T17:21:35.000Z","dependencies_parsed_at":"2024-01-13T16:17:19.929Z","dependency_job_id":"7489dff7-173f-40d7-ac52-2ab683409b04","html_url":"https://github.com/ko-build/setup-ko","commit_stats":{"total_commits":50,"total_committers":8,"mean_commits":6.25,"dds":0.54,"last_synced_commit":"201cc87dc2ab4118f38a5ee236425023d349f408"},"previous_names":["imjasonh/setup-ko"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-build%2Fsetup-ko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-build%2Fsetup-ko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-build%2Fsetup-ko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-build%2Fsetup-ko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ko-build","download_url":"https://codeload.github.com/ko-build/setup-ko/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312080,"owners_count":20918344,"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":[],"created_at":"2024-08-03T00:00:36.820Z","updated_at":"2025-04-05T09:07:53.199Z","avatar_url":"https://github.com/ko-build.png","language":"Go","readme":"# GitHub Action to install and setup [`ko`](https://github.com/ko-build/ko)\n\n[![Build](https://github.com/ko-build/setup-ko/actions/workflows/use-action.yaml/badge.svg)](https://github.com/ko-build/setup-ko/actions/workflows/use-action.yaml)\n\n\u003e :warning: Note: `ko` recently [moved to its own GitHub org](https://github.com/ko-build/ko/issues/791), which broke `setup-ko@v0.5` if the `ko` version wasn't specified.\n\u003e\n\u003e To fix this, either upgrade to \u003e= [`setup-ko@v0.6`](https://github.com/ko-build/setup-ko/releases/tag/v0.6) or specify `version`\n\n## Example usage\n\n```yaml\nname: Publish\n\non:\n  push:\n    branches: ['main']\n\njobs:\n  publish:\n    name: Publish\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-go@v5\n        with:\n          go-version: '1.23.x'\n\n      - uses: ko-build/setup-ko@v0.8\n      - run: ko build\n```\n\n_That's it!_ This workflow will build and publish your code to [GitHub Container Regsitry](https://ghcr.io).\n\nBy default, the action sets `KO_DOCKER_REPO=ghcr.io/[owner]/[repo]` for all subsequent steps, and uses the `${{ github.token }}` to authorize pushes to GHCR.\n\nSee [documentation for `ko`](https://ko.build/configuration/) to learn more about configuring `ko`.\n\nThe action works on Linux and macOS [runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners).\nIf you'd like support for Windows runners, [let us know](https://github.com/ko-build/setup-ko/issues/new)!\n\n### Select `ko` version to install\n\nBy default, `ko-build/setup-ko` installs the [latest released version of `ko`](https://github.com/ko-build/ko/releases).\n\nYou can select a version with the `version` parameter:\n\n```yaml\n- uses: ko-build/setup-ko@v0.8\n  with:\n    version: v0.17.1\n```\n\nTo build and install `ko` from source using `go install`, specify `version: tip`.\n\n### Pushing to other registries\n\nBy default, `ko-build/setup-ko` configures `ko` to push images to [GitHub Container Registry](https://ghcr.io), but you can configure it to push to other registries as well.\n\nIf `KO_DOCKER_REPO` is already set when `setup-ko` runs, it will skip logging in to ghcr.io and will propagate `KO_DOCKER_REPO` for subsequent steps.\n\nTo do this, you should provide credentials to authorize the push.\nYou can use [encrypted secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) to store the authorization token, and pass it to `ko login` before pushing:\n\n```yaml\nsteps:\n...\n- uses: ko-build/setup-ko@v0.8\n  env:\n    KO_DOCKER_REPO: my.registry/my-repo\n- env:\n    auth_token: ${{ secrets.auth_token }}\n  run: |\n    echo \"${auth_token}\" | ko login https://my.registry --username my-username --password-stdin\n    ko build\n```\n\n### Release Integration\n\nIn addition to publishing images, `ko` can produce YAML files containing references to built images, using [`ko resolve`](https://ko.build/features/k8s)\n\nWith this action, you can use `ko resolve` to produce output YAML that you then attach to a GitHub Release using the [GitHub CLI](https://cli.github.com).\nFor example:\n\n```yaml\nname: Publish Release YAML\n\non:\n  release:\n    types:\n      - 'created'\n\njobs:\n  publish-release-yaml:\n    name: Publish Release YAML\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-go@v5\n        with:\n          go-version: '1.23'\n\n      - uses: ko-build/setup-ko@v0.8\n\n      - name: Generate and upload release.yaml\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        run: |\n          tag=$(echo ${{ github.ref }} | cut -c11-)  # get tag name without tags/refs/ prefix.\n          ko resolve -t ${tag} -f config/ \u003e release.yaml\n          gh release upload ${tag} release.yaml\n```\n\n### A note on versioning\n\nThe `@v0.X` in the `uses` statement refers to the version _of the action definition in this repo._\n\nRegardless of what version of the action definition you use, `ko-build/setup-ko` will install the latest released version of `ko` unless otherwise specified with `version:`.\n","funding_links":[],"categories":["others","Community Resources"],"sub_categories":["Deployment"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fko-build%2Fsetup-ko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fko-build%2Fsetup-ko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fko-build%2Fsetup-ko/lists"}