Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: corefunc_github_assets #134

Open
skyzyx opened this issue Feb 5, 2024 · 0 comments
Open

[Feature]: corefunc_github_assets #134

skyzyx opened this issue Feb 5, 2024 · 0 comments
Assignees

Comments

@skyzyx
Copy link
Member

skyzyx commented Feb 5, 2024

What functionality would you like to see?

Download assets from GitHub.com/GitHub Enterprise Server.

corefunc_github_assets "trivy" {
  endpoint = "https://api.github.com" # Default value
  token    = var.ghes_token # Use GITHUB_TOKEN for GitHub.com, or GHE_TOKEN for GitHub Enterprise

  repository  = "aquasecurity/trivy"
  version     = "~> 0.40" # Default value is latest
  asset_match = "${OS}-${ARCH}.tar.gz$"
  decompress  = true # Default
  save_as     = "${path}/trivy.tar.gz" # Useful when download is uncompressed binary

  // If you want to simplify the path
  symlink = {
    from = "bin/trivy*",
    to   = "trivy",
  }

  // When current OS is… set ${OS} to…
  set_os_value_when = {
    linux   = "Linux"
    darwin  = "Darwin"
    windows = "Windows"
    solaris = "Solaris"
    freebsd = "FreeBSD"
    openbsd = "OpenBSD"
    netbsd  = "NetBSD"
  }

  // When current CPU architecture is… set ${ARCH} to…
  set_arch_value_when = {
    intel32 = "32bit"
    intel64 = "64bit"
    arm32   = "ARM"
    arm64   = "ARM64"
    ppc32   = "PPC"
    ppc64   = "PPC64LE"
    s390x   = "s390x"
  }
}
@skyzyx skyzyx self-assigned this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant