Servus /ˈzɛrvʊs/
, I'm Stefan 👋
Senior Manager, Services Delivery EMEA at @github.
Previously 🌱@sencha and 🐘@eyeworkers
gh cli extension to generate account/organization/enterprise reports
License: MIT License
Servus /ˈzɛrvʊs/
, I'm Stefan 👋
Senior Manager, Services Delivery EMEA at @github.
Previously 🌱@sencha and 🐘@eyeworkers
The reproduction sort of describes the error succinctly. I have admin:org
on my token (playing with a different extension and I haven’t lowered the privileges yet), but we are on the Team plan. Running gh report billing --owner FOO
without explicitly excluding the Advanced Security report results in code termination with an HTTP 403 (advanced security cannot be enabled on the team plan).
Steps to reproduce the behavior:
$ gh report billing --owner TeamName
⠇ fetching KineticCommerce billing report (security data)Error: HTTP 403: repository not enabled for code scanning (https://api.github.com/orgs/KineticCommerce/settings/billing/advanced-security)
Usage:
report billing [flags]
Flags:
--actions Get GitHub Actions billing
--all Get all billing data (default true)
-h, --help help for billing
--packages Get GitHub Packages billing
--security Get GitHub Advanced Security active committers
--storage Get shared storage billing
Global Flags:
--csv string Path to CSV file, to save report to file
-e, --enterprise read:enterprise GitHub Enterprise Cloud account (requires read:enterprise scope)
--hostname string GitHub Enterprise Server hostname (default "github.com")
--json string Path to JSON file, to save report to file
--md string Path to MD file, to save report to file
--no-cache Do not cache results for one hour (default "false")
-o, --owner read:org GitHub account organization (requires read:org scope) or user account (requires `n/a` scope)
-r, --repo repo GitHub repository (owner/repo), requires repo scope
--silent Do not print any output (default: "false")
-t, --token string GitHub Personal Access Token (default "gh auth token")
HTTP 403: repository not enabled for code scanning (https://api.github.com/orgs/KineticCommerce/settings/billing/advanced-security)
I would expect to see the report without having to specify --packages --storage --actions
.
--security
is passed explicitly.--security=false
or --no-security
.Add any other context about the problem here.
darwin-arm64
is not supported.
gh extension upgrade stoe/gh-report
darwin-arm64
is supported.
(please complete the following information)
$ gh extension install stoe/gh-report
gh-report unsupported for darwin-arm64.
Support darwin-arm64
n/a
n/a
$ gh report billing --token "${GH_PAT}" -e stoelzle
⠋Error: json: cannot unmarshal number 50000.0 into Go struct field ActionsBilling.included_minutes of type int
Usage:
gh-report billing [flags]
Flags:
--actions Get GitHub Actions billing
--all Get all billing data (default true)
-h, --help help for billing
--packages Get GitHub Packages billing
--security Get GitHub Advanced Security active committers
--storage Get shared storage billing
Global Flags:
--csv string Path to CSV file
-e, --enterprise string GitHub Enterprise Cloud account
--hostname string GitHub Enterprise Server hostname
--json string Path to JSON file
--no-cache do not cache results for one hour (default: false)
-o, --owner string GitHub account (organization or user account)
-r, --repo string GitHub repository (owner/repo)
--silent do not print any output (default: false)
--token string GitHub Personal Access Token (default: "")
json: cannot unmarshal number 50000.0 into Go struct field ActionsBilling.included_minutes of type int
This is a message from the GitHub CLI team, maintainers of gh
, writing to inform you that the most recent release of gh
contains changes which may affect your extension. The latest release introduces the feature of storing authentication tokens in the system keyring (encrypted storage) instead of in a plain text file.
The keyrings that are supported are:
Keychain on macOS
GNOME Keyring on Linux (Secret Service dbus interface)
Wincred on Windows
This has huge security benefits for the users of our tool and was one of our oldest outstanding issues. Unfortunately this change has the potential to break extensions that rely on utilizing the users authentication token to work.
In order to have continued compatibility with gh
there are some actions you, as an extension author, need to take. These actions will depend on the implementation of your extension.
Upgrade your go-gh
version to v1.2.1, the latest version.
go get github.com/cli/[email protected]
Verify that in your extension retrieval of the user authentication token is done using the auth.TokenForHost
function.
Verify that in your extension retrieval of the user authentication token is done by shelling out to the gh auth token
command.
gh config get
command, reading the configuration file directly, or any other methods it will no longer work.As of right now storing the authentication token in the system keyring is an opt-in feature, but in the near future it will be required and at that point if the changes above are not made then your extension will be broken for all users. If you have any questions/concerns about this change please feel free to open a discussion in the gh repo.
Thanks,
The GitHub CLI Team
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.