{"id":14968075,"url":"https://github.com/knl/niv-updater-action","last_synced_at":"2025-10-05T00:49:42.298Z","repository":{"id":43125370,"uuid":"241917428","full_name":"knl/niv-updater-action","owner":"knl","description":"A GitHub Action that creates meaningful pull requests with updates to your niv-managed dependencies, so you don't have to do menial chores.","archived":false,"fork":false,"pushed_at":"2024-10-17T09:53:08.000Z","size":386,"stargazers_count":29,"open_issues_count":6,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-25T20:03:59.135Z","etag":null,"topics":["bash","dependency-manager","github-actions","niv","nix"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knl.png","metadata":{"files":{"readme":"README.adoc","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":"2020-02-20T15:21:15.000Z","updated_at":"2024-12-13T09:30:59.000Z","dependencies_parsed_at":"2023-12-28T10:30:09.666Z","dependency_job_id":"6084f36c-ae89-46e0-8df8-a0442a91805e","html_url":"https://github.com/knl/niv-updater-action","commit_stats":{"total_commits":112,"total_committers":11,"mean_commits":"10.181818181818182","dds":0.2142857142857143,"last_synced_commit":"b7c1567150eeb15868ca90c9a959851f34e057bb"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knl%2Fniv-updater-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knl%2Fniv-updater-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knl%2Fniv-updater-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knl%2Fniv-updater-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knl","download_url":"https://codeload.github.com/knl/niv-updater-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252741371,"owners_count":21797027,"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":["bash","dependency-manager","github-actions","niv","nix"],"created_at":"2024-09-24T13:39:12.602Z","updated_at":"2025-10-05T00:49:37.260Z","avatar_url":"https://github.com/knl.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"= niv-updater: Automated dependency updates with niv\n\nimage:https://github.com/knl/niv-updater-action/actions/workflows/main.yml/badge.svg[CI]\nimage:https://img.shields.io/github/v/release/knl/niv-updater-action[GitHub release (latest by date)]\n\nThis action will open a pull request to `master` branch (or otherwise specified\nbranch) whenever https://github.com/nmattia/niv[niv] detects updates to\n`nix/sources.json` in your repository, for each dependency separately. Each PR\nwill contain a beautiful Changelog of all the changes in the update, like this:\n\nimage:./assets/niv-update-action-changelog.png[title=\"Changelog generated by niv-updater-action]\n\nThe best way to use `niv-updater-action` is to set up a scheduled workflow. This\nway, whenever there are new updates, you will get a PR that you can just\napprove and avoid a lot of manual work.\n\n== Example\n\nHere is an minimal example of what to put in your\n`+.github/workflows/niv-updates.yml+` file to trigger the action.\n\n[source,yaml]\n----\nname: Automated niv-managed dependency updates\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this string\n    # run this every day at 4:00am\n    - cron:  '0 4 * * *'\njobs:\n  niv-updater:\n    name: 'Create PRs for niv-managed dependencies'\n    runs-on: ubuntu-latest\n    steps:\n      # notice there is no checkout step\n      - name: niv-updater-action\n        uses: knl/niv-updater-action@v15\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n----\n\n== Configuration\n\n=== Inputs\n\n`niv-updater-action` is configured using the following inputs:\n\n* `pull_request_base`: (Optional) The name of the branch to issue the pull request\n  against. In addition, the name of the branch from which `nix/sources.json` is\n  taken from as the base. Defaults to an empty string which means taking as the\n  base the default branch for the repository.\n* `sources_file`: (Optional) The path in the repo to the `sources.json` file.\n  This value will be passed to niv via `--sources-file` option. Defaults to\n  `nix/sources.json`.\n* `niv_version`: (Optional) The niv version to be used. Defaults to `master`,\n  meaning `niv-updater-action` will take the latest niv for each run. You may want\n  to fix a particular version and avoid future breaks to your workflow. If you're\n  using a self-hosted runner, set this to `*from-nixpkgs*`.\n* `branch_prefix`: (Optional) The prefix used for update branches, created by\n  this action. The action does not sanitize the branch name. For a description\n  of what a valid branch name is, please consult:\n  https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html.\n  Defaults to `update/`.\n* `keep_updating`: (Optional) If PR already exists, keep it updated with new\n  changes. The branch will be force updated, as this process keeps a single\n  commit on a branch. Defaults to `false` to maintain the old behaviour.\n* `skip_versioned_revisions`: (Optional, a boolean) If `true`, will cause the\n  action to skip updating any dependency that has a version in their revision.\n  This is due to the way niv currently works, where it will always update to the\n  latest HEAD of a branch. Thus, if one have a dependency where, for example,\n  `rev=v1.0.0`, niv would normally update it to the latest head of the branch,\n  making `rev` holding the appropriate SHA. This is something one would not\n  normally expect. Thus, this option exists until niv fixes the behaviour.\n  Defaults to `true`.\n* `skip_ssh_repos`: (Optional, a boolean) If `true`, will cause the action to\n  skip updating any dependency that is hosted by a repo accessible via ssh.\n  Defaults to `false`.\n* `whitelist`: (Optional) A list of dependencies, comma separated, that will be\n  checked for updates. This list will be checked *before* the blacklist.\n  Defaults to an empty string, which is a _special case_ for looking into all\n  dependencies tracked by `niv`.\n* `blacklist`: (Optional) A list of dependencies, comma separated, to skip from\n  updating. This list will be checked *after* the whitelist. Defaults to an\n  empty string, which means all dependencies will be checked for updates.\n* `labels`: (Optional) A list of labels, **newline** separated, to apply to all\n  created PRs. Defaults to an empty string, meaning no labels will be applied.\n  The list has to be newline separated (use YAML's `|` block), as GitHub allows\n  various characters in the label's name, except the newline.\n* `show_merges`: (Optional, a boolean) If `true`, the changelog will contain\n  merge commits listed. Otherwise, they will be skipped (however, the commits\n  from the PRs/branches will shown). Defaults to `false`.\n* `message_prefix`: (Optional) The text that will be put in front of the\n  generated changelog. Defaults to empty.\n* `message_suffix`: (Optional) The text that will be put in after the generated\n  changelog. Defaults to empty.\n* `title_prefix`: (Optional) The text that will be put in front of the\n  generated commit title. Defaults to empty.\n* `github_changelog_no_backreferences`: (Optional, a boolean) If `true`, the\n  changelog will transform all issue links to links via a redirector\n  (DuckDuckGo), to prevent GitHub from backreferencing the created PR in these\n  issues. For more details, see\n  https://github.com/knl/niv-updater-action/issues/26[Issue #26]. Defaults to\n  `true`.\n* `debug_output`: (Optional, a boolean) If `true`, `set -x` will be turned on\n  for the updater script, outputting every step the action takes. This will show\n  up in the action log, and could be useful for trying to reproduce issues\n  locally. Defaults to `false`.\n\nAs the above list suggests, `niv-updater-action` is highly configurable.\nThe following example exposes some of the knobs, many with their default values:\n\n[source,yaml]\n----\nname: Automated niv-managed dependency updates\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this string\n    # run this every day at 4:00am\n    - cron:  '0 4 * * *'\njobs:\n  niv-updater:\n    name: 'Create PRs for niv-managed dependencies'\n    runs-on: ubuntu-latest\n    steps:\n      # notice there is no checkout step\n      - name: niv-updater-action\n        uses: knl/niv-updater-action@v15\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          # NOTE: All inputs are optional. This list them with their default values.\n          # Use the default branch for the repository\n          pull_request_base: ''\n          # The path in the repo to the sources.json file\n          sources_file: 'nix/sources.json'\n          # The niv version to use. `master` will track the latest niv.\n          niv_version: 'master'\n          # Keep the PR updated with new changes\n          keep_updating: true\n          # The prefix to add to every created branch\n          branch_prefix: 'update/'\n          # Update all dependencies tracked by niv. Another example: 'common,jq,hub'\n          whitelist: ''\n          # Do not blacklist any of the dependencies. Another example: 'nixpkgs,niv'\n          blacklist: ''\n          # Note that | is really important for the labels\n          labels: |\n            documentation\n            good first issue\n          # Have some prefix and a suffix. Use '|' to keep newlines\n          message_prefix: |\n            ## Motivation\n\n            Dependencies should be up to date.\n          message_suffix:\n            Notify @myorg/myteam.\n          # Have a prefix to the commit title itself, for example, to support conventional commits.\n          title_prefix: refactor:\n----\n\n== Secrets\n\nSecrets are similar to inputs except that they are encrypted and only used by\nGitHub Actions. It's a convenient way to keep sensitive data out of the GitHub\nActions workflow YAML file.\n\n* `GITHUB_TOKEN` - (Required) The GitHub API token used to create pull requests\n  and get content from all repositories tracked by `niv`.\n\n== Self hosted runner\n\nSelf-hosted runners are running with dynamic users so nix profile is not\naccessible, as well as nix-env. As this action relies on nix-env to install\nniv, the default configuration will not work. Thus, to use niv from available\nnixpkgs, set `niv_version` to `pass:[*from-nixpkgs*]`. It will install `niv`\nusing `nixpkgs` with nix-shell instead of nix-env.\n\nTo avoid using `sudo` (also unavailable on self-hosted runners), the input\n`pass:[skip_ssh_repos]` should be set to `true`.\n\nExample:\n\n[source,yaml]\n----\nname: Automated niv-managed dependency updates\non:\n  schedule:\n    # * is a special character in YAML so you have to quote this string\n    # run this every day at 4:00am\n    - cron:  '0 4 * * *'\njobs:\n  niv-updater:\n    name: 'Create PRs for niv-managed dependencies'\n    runs-on: self-hosted\n    steps:\n      # notice there is no checkout step\n      - name: niv-updater-action\n        uses: knl/niv-updater-action@v15\n        with:\n          niv_version: '*from-nixpkgs*'\n          skip_ssh_repos: true\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknl%2Fniv-updater-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknl%2Fniv-updater-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknl%2Fniv-updater-action/lists"}