{"id":20532490,"url":"https://github.com/joshdk/actions-docker-shim","last_synced_at":"2026-05-08T05:03:07.015Z","repository":{"id":225096780,"uuid":"753891114","full_name":"joshdk/actions-docker-shim","owner":"joshdk","description":"🐋 Shim that enables using private ghcr.io images in GitHub Actions.","archived":false,"fork":false,"pushed_at":"2024-02-27T04:59:37.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T02:49:09.326Z","etag":null,"topics":["docker","ghcr","ghcr-image","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshdk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-02-07T01:24:49.000Z","updated_at":"2024-09-25T16:09:44.000Z","dependencies_parsed_at":"2024-02-29T08:45:56.195Z","dependency_job_id":null,"html_url":"https://github.com/joshdk/actions-docker-shim","commit_stats":null,"previous_names":["joshdk/actions-docker-shim"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/joshdk/actions-docker-shim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Factions-docker-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Factions-docker-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Factions-docker-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Factions-docker-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdk","download_url":"https://codeload.github.com/joshdk/actions-docker-shim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Factions-docker-shim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502344,"owners_count":23618577,"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":["docker","ghcr","ghcr-image","github-actions"],"created_at":"2024-11-16T00:15:13.516Z","updated_at":"2025-10-16T04:35:12.999Z","avatar_url":"https://github.com/joshdk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License][license-badge]][license-link]\n[![Actions][github-actions-badge]][github-actions-link]\n[![Releases][github-release-badge]][github-release-link]\n\n# GitHub Actions Docker Shim\n\n🐋 Shim that enables using private ghcr.io images in GitHub Actions.\n\n## Motivations\n\nCurrently, there isn't a good story for authoring GitHub Actions backed by private Docker images.\nUnlike workflow [services](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservicesservice_idcredentials) and [jobs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontainercredentials), there is no way to transparently provide registry credentials to image backed Actions.\nSome potential workarounds include manually authenticating inside a composite action, deploying your own Action runners, or making your image public.\n\nThis repository produces a tool which aims to solve this problem as seamlessly as possible.\n\n## Usage\n\n\u003e [!NOTE]\n\u003e These examples assumes that you author an action from a repository named `Example/example-action`, which produces an image named `ghcr.io/example/example-action`.\n\n### Initial Integration\n\nModify your `action.yml` to use the latest release of `ghcr.io/joshdk/actions-docker-shim` and to add a `token` input with a default value of `${{ github.token }}`.\n\n```diff\nname: Example\ndescription: An example action, wow!\n\n+inputs:\n+  token:\n+    description: GitHub Actions workflow token.\n+    default: ${{ github.token }}\n\nruns:\n  using: docker\n-  image: docker://ghcr.io/example/example-action:v1.2.3\n+  image: docker://ghcr.io/joshdk/actions-docker-shim:v0.1.0\n```\n\nModify the caller workflow to grant the `packages: read` permission so that your ghcr.io image can be pulled.\n\n```diff\njobs:\n  example:\n+    permissions:\n+      packages: read\n\n    steps:\n      - uses: Example/example-action@v1.2.3\n```\n\n#### How this works\n\nWhen GitHub runs a workflow which references your action, the `ghcr.io/joshdk/actions-docker-shim` image is pulled and run instead of your image.\n\nThe shim determines the name of the GitHub repository which hosts this action (`Example/example-action`) and the ref at which this action was references (`v1.2.3`).\nUsing this information, the name of this image is speculated to be `ghcr.io/example/example-action:v1.2.3`.\n\nThe shim performs a login to ghcr.io using the provided `token` input, and then pulls the target image.\n\nFinally, the target image is run on the GitHub runner using the same set of volume mappings, environment variables, \u0026 arguments that GitHub **would** have used to run your image.\n\n### Specifying Images\n\nBy default, the git tag/branch/sha that is used when referring to your action will be used to determine the image tag to run.\nYou can see here how the image name is derived.\n\n```yaml\njobs:\n  example:\n    steps:\n      # Will run ghcr.io/example/example-action:v1.2.3\n      - uses: Example/example-action@v1.2.3\n\n      # Will run ghcr.io/example/example-action:v1.2\n      - uses: Example/example-action@v1.2\n\n      # Will run ghcr.io/example/example-action:v1\n      - uses: Example/example-action@v1\n\n      # Will run ghcr.io/example/example-action:master\n      - uses: Example/example-action@master\n      \n      # Will run ghcr.io/example/example-action:a35f...b316\n      - uses: Example/example-action@a35f...b316\n```\n\nIf you want your action to use a specific image tag, then you can set one manually in `action.yml`.\n\n```diff\nruns:\n  using: docker\n  image: docker://ghcr.io/joshdk/actions-docker-shim:v0.1.0\n+  args:\n+    - --shim-image-tag=snapshot\n```\n\nIf your image isn't named the same as your action repository, that can be overridden as well.\n\n```diff\nruns:\n  using: docker\n  image: docker://ghcr.io/joshdk/actions-docker-shim:v0.1.0\n  args:\n    - --shim-image-tag=snapshot\n+    - --shim-image=example/some-other-image\n```\n\n### Authentication\n\nIf you need to provide a token using a custom input name (e.g. to avoid changing the interface for your action) then you can specify the env var name to use.  \n\n```diff\nname: Example\ndescription: An example action, wow!\n\ninputs:\n-  token:\n+  custom-token:\n    description: GitHub Actions workflow token.\n    default: ${{ github.token }}\n\nruns:\n  using: docker\n  image: docker://ghcr.io/joshdk/actions-docker-shim:v0.1.0\n+  args:\n+    - --shim-token-env=INPUT_CUSTOM-TOKEN\n```\n\n## License\n\nThis code is distributed under the [MIT License][license-link], see [LICENSE.txt][license-file] for more information.\n\n[github-actions-badge]:  https://github.com/joshdk/actions-docker-shim/workflows/Build/badge.svg\n[github-actions-link]:   https://github.com/joshdk/actions-docker-shim/actions\n[github-release-badge]:  https://img.shields.io/github/release/joshdk/actions-docker-shim/all.svg\n[github-release-link]:   https://github.com/joshdk/actions-docker-shim/releases\n[license-badge]:         https://img.shields.io/badge/license-MIT-green.svg\n[license-file]:          https://github.com/joshdk/actions-docker-shim/blob/master/LICENSE.txt\n[license-link]:          https://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdk%2Factions-docker-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdk%2Factions-docker-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdk%2Factions-docker-shim/lists"}