{"id":15901585,"url":"https://github.com/axel-op/self-contained-dart-github-action","last_synced_at":"2026-05-02T03:32:25.574Z","repository":{"id":103260164,"uuid":"461336031","full_name":"axel-op/self-contained-dart-github-action","owner":"axel-op","description":"A template to demonstrate how to build a self-contained Dart GitHub Action, that doesn't need a Dart container to run","archived":false,"fork":false,"pushed_at":"2022-02-27T15:13:33.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T17:59:06.334Z","etag":null,"topics":["dart","dart2native","github-action","github-actions","github-actions-docker","github-container-registry","github-packages"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axel-op.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-02-19T23:15:28.000Z","updated_at":"2022-02-23T10:51:46.000Z","dependencies_parsed_at":"2023-03-06T10:45:40.010Z","dependency_job_id":null,"html_url":"https://github.com/axel-op/self-contained-dart-github-action","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.2222222222222222,"last_synced_commit":"0fac33906b41f56196e70ed0bc863509e601c853"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/axel-op/self-contained-dart-github-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axel-op%2Fself-contained-dart-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axel-op%2Fself-contained-dart-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axel-op%2Fself-contained-dart-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axel-op%2Fself-contained-dart-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axel-op","download_url":"https://codeload.github.com/axel-op/self-contained-dart-github-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axel-op%2Fself-contained-dart-github-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32522245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dart","dart2native","github-action","github-actions","github-actions-docker","github-container-registry","github-packages"],"created_at":"2024-10-06T11:05:08.910Z","updated_at":"2026-05-02T03:32:25.540Z","avatar_url":"https://github.com/axel-op.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Self-contained Dart GitHub Action\n\n\u003e [See here](https://gist.github.com/axel-op/deff66ac2f28a01813193d90de36c564) for a comparison of the different ways to build a GitHub Action with Dart.\n\nIn 2020, I published the Pub package [`github_actions_toolkit`](https://pub.dev/packages/github_actions_toolkit) to write GitHub Actions with Dart more easily. However, using such actions in a workflow is still cumbersome, as they need [a full Dart container to be pulled](https://github.com/axel-op/containerized-dart-action) before they can be run, which is very time consuming for these scripts that generally run in a few seconds.\n\nThis repository is a template to demonstrate how to create a GitHub Action with Dart that is self-contained in a tiny Docker container, that can be pulled and used in a workflow very quickly.\n\n## How it works\n\nThe repository leverages the [`dart compile`](https://dart.dev/tools/dart-compile#exe) (ex `dart2native`) command and [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) to package and publish the Dart action as a small container image.\n\n[A GitHub Action workflow](.github/workflows/push.yml) automatically compiles the Dart application into a native executable using `dart compile`. Then, this executable is wrapped in a Docker container that contains only the libraries required to run it. Finally, the image of this container is published on GitHub Container Registry using the Docker API.\n\nBy default, the full image tag is `{OWNER}/{REPOSITORY}:{BRANCH}`, where `BRANCH` is the branch on which the workflow that published the image was executed.\n\nThe image is listed at the address [`github.com/{OWNER}/{REPOSITORY}/packages`](https://github.com/axel-op/self-contained-dart-action/packages).\n\n## How to use it in a workflow\n\nThe following workflow is inspired by the [`Hello World` example of the GitHub documentation](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action#example-using-a-private-action):\n\n```yml\non: [push]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - name: Hello World action step\n        # docker://{host}/{image}:{tag}\n        # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-the-github-packages-container-registry\n        uses: docker://ghcr.io/axel-op/self-contained-dart-action:main\n        id: hello\n        with:\n          who-to-greet: \"you\"\n      # Use the output from the `hello` step\n      - name: Get the output time\n        run: echo \"The time was ${{ steps.hello.outputs.time }}\"\n```\n\n![](https://user-images.githubusercontent.com/49279289/154850348-3650dc94-a1d7-47ce-a721-6ac07247bf5f.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxel-op%2Fself-contained-dart-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxel-op%2Fself-contained-dart-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxel-op%2Fself-contained-dart-github-action/lists"}