Thanks to visit codestin.com
Credit goes to github.com

Skip to content

suzuki-shunsuke/ghir

Repository files navigation

ghir (GitHub Immutable Releases)

Install

ghir is a CLI making past GitHub Releases immutable.

About GitHub Immutable Releases, please see the following links:

Immutable Releases protect your software supply chain by preventing any changes to released assets. While enabling Immutable Releases is straightforward, previously created releases remain vulnerable. ghir is a CLI tool that secures your past releases by making them immutable.

How To Use

  1. Enable Immutable Releases
  2. Run ghir
ghir [--log-level <debug|info|warn|error>] [--enable-ghtkn] <repo full name>

e.g.

ghir aquaproj/aqua

GitHub Access Token

ghir requires a GitHub Access Token.

  • Required Permissions: contents:write
  • Scopes (accessible repositories): A repository to be updated

Environment Variables

  1. GHIR_GITHUB_TOKEN
  2. GITHUB_TOKEN

Or you can also use ghtkn integration.

ghir --enable-ghtkn <repo>

Or

export GHIR_ENABLE_GHTKN=true

How It Works

  1. Get GitHub Releases by GitHub API
  2. Exclude draft releases and immutable releases
  3. Update releases without any parameters by GitHub API to make all releases immutable

ProTip: Run ghir for multiple repositories

ghir alone can only be executed in a single repository.

However, by combining other tools, you can run ghir against multiple repositories.

Example 1: use repository list file

cat repos.txt
username_or_orgname/foo
username_or_orgname/bar

cat repos.txt | xargs -n 1 ghir

Example 2: use gh repo list

gh repo list <username_or_orgname> --source --no-archived --json nameWithOwner --template '{{range .}}{{.nameWithOwner}}{{"\n"}}{{end}}' --limit 100 | xargs -n 1 ghir

Note

Release attestations aren't created if releases were created before April 2025. I sent a feature request to GitHub. For more details, please see the discussion.

LICENSE

MIT

About

ghir is a CLI making past GitHub Releases immutable

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages