{"id":16333686,"url":"https://github.com/gerschtli/generate-nix-hash","last_synced_at":"2025-10-25T23:30:43.560Z","repository":{"id":42859980,"uuid":"258778302","full_name":"Gerschtli/generate-nix-hash","owner":"Gerschtli","description":"Github Action to write a JSON file with rev and sha256 of given repository revision.","archived":true,"fork":false,"pushed_at":"2023-09-17T21:16:10.000Z","size":1068,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-26T16:41:43.460Z","etag":null,"topics":["actions","github","nix","nixpkgs"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Gerschtli.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}},"created_at":"2020-04-25T13:09:01.000Z","updated_at":"2024-06-25T02:45:39.000Z","dependencies_parsed_at":"2023-02-15T12:01:09.454Z","dependency_job_id":null,"html_url":"https://github.com/Gerschtli/generate-nix-hash","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerschtli%2Fgenerate-nix-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerschtli%2Fgenerate-nix-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerschtli%2Fgenerate-nix-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gerschtli%2Fgenerate-nix-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gerschtli","download_url":"https://codeload.github.com/Gerschtli/generate-nix-hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238223615,"owners_count":19436717,"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":["actions","github","nix","nixpkgs"],"created_at":"2024-10-10T23:36:17.072Z","updated_at":"2025-10-25T23:30:43.219Z","avatar_url":"https://github.com/Gerschtli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generate Nix Hash\n[![Github Workflow](https://github.com/Gerschtli/generate-nix-hash/workflows/build-test/badge.svg)](https://github.com/Gerschtli/generate-nix-hash/actions)\n\nThis action fetches the `.tar.gz` archive of the provided repository revision and creates a JSON file containing the revision and sha256 hash generated by `nix-prefetch-url`. As a consequence [`nix`](https://nixos.org/nix) is needed for this action as shown in the example below.\n\n## Usage\n\nCreate `.github/workflows/test.yml` in your repo with the following contents:\n\n```yaml\nname: \"Test\"\non:\n  pull_request:\n  push:\njobs:\n  tests:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: cachix/install-nix-action@v8\n      - uses: Gerschtli/generate-nix-hash@v1\n        with:\n          rev: c61573364694a68d9993c8b0fb603b29e7251d79  # commit id\n          owner: Gerschtli\n          repo: generate-nix-hash\n          file: config.json\n```\n\nThis produces a JSON file like:\n```json\n{\n  \"rev\": \"c61573364694a68d9993c8b0fb603b29e7251d79\",\n  \"sha256\": \"1s0qrrin8ry9klvjaxj4hd3qlf3cayfisq8pn7idqddgcg0lc079\"\n}\n```\n\nSee [action.yml](action.yml) for all options.\n\n---\n\n## Publish to a distribution branch\n\nActions are run from GitHub repos so we will checkin the packed dist folder.\n\nThen run [ncc](https://github.com/zeit/ncc) and push the results:\n```bash\n$ npm run pack\n$ git add dist\n$ git commit -a -m \"prod dependencies\"\n$ git push origin releases/v1\n```\n\nYour action is now published! :rocket:\n\nSee the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerschtli%2Fgenerate-nix-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerschtli%2Fgenerate-nix-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerschtli%2Fgenerate-nix-hash/lists"}