diff --git a/README.md b/README.md index 06ec640f..9241423e 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ jobs: token: ${{ secrets.GHSTATS_TOKEN }} # classic PAT with read:user + repo themes: dracula,github_dark,tokyonight tz: Asia/Saigon - include_forks: "false" - include_private: "false" + include_forks: "true" + include_private: "true" commit_changes: "true" ``` @@ -77,8 +77,8 @@ Then embed the cards in your `README.md`: | `tz` | `UTC` | IANA tz for the productive-time card (e.g. `Asia/Saigon`) | | `top_repos` | `0` | Optional cap on seed repos probed for commit history (`0` = unlimited) | | `commits_per_repo` | `500` | Max commits sampled per repo (covers last-year and all-time aggregates) | -| `include_forks` | `false` | Include forked repos in stats and commit probing | -| `include_private` | `false` | Include private repos (requires PAT with `repo` scope) | +| `include_forks` | `true` | Include forked repos in stats and commit probing | +| `include_private` | `true` | Include private repos (requires PAT with `repo` scope; silently no-op otherwise) | | `commit_changes` | `false` | Commit generated cards back to the repo | | `commit_message` | `chore: update ghstats cards` | Commit message | | `commit_branch` | *(current ref)* | Target branch for auto-commit | @@ -115,8 +115,8 @@ ghstats -user tiennm99 -themes dracula,github_dark -tz Asia/Saigon -out output | `-tz` | `Local` | IANA timezone for productive-time cards | | `-top-repos` | `0` | Optional cap on seed repos probed (`0` = unlimited) | | `-commits-per-repo` | `500` | Max commits sampled per repo | -| `-include-forks` | `false` | Include forked repos in the stats | -| `-include-private` | `false` | Include private repos (requires `repo` PAT scope) | +| `-include-forks` | `true` | Include forked repos in the stats | +| `-include-private` | `true` | Include private repos (requires `repo` PAT scope; silently no-op otherwise) | | `-list-themes` | | Print available theme ids and exit | ## How attribution works @@ -164,8 +164,10 @@ themes are rebuilt on each run and gitignored. The default `${{ github.token }}` can read public user data but will not see your private-repo commits. For accurate stats, create a **classic** personal access token with `read:user` and `repo`, save it as a repo secret (e.g. -`GHSTATS_TOKEN`), and pass it via the `token` input. Then pair with -`include_private: "true"` to have those commits actually counted. +`GHSTATS_TOKEN`), and pass it via the `token` input. `include_private` +defaults to `true` so those commits are counted automatically once the token +has `repo` scope; pass `include_private: "false"` if you want to keep private +work out of the rendered cards even when the token can see it. ## Credits & inspiration diff --git a/action.yml b/action.yml index 75649503..688d422a 100644 --- a/action.yml +++ b/action.yml @@ -38,11 +38,11 @@ inputs: include_forks: description: Include forked repos in stats and commit probing required: false - default: "false" + default: "true" include_private: - description: Include private repos (requires PAT with repo scope) + description: Include private repos (requires PAT with repo scope; silently no-op otherwise) required: false - default: "false" + default: "true" commit_changes: description: Whether to commit the generated cards back to the repo required: false diff --git a/entrypoint.sh b/entrypoint.sh index e5845915..d373ec1d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,8 +13,8 @@ themes="${INPUT_THEMES:-dracula}" tz="${INPUT_TZ:-UTC}" top_repos="${INPUT_TOP_REPOS:-0}" commits_per_repo="${INPUT_COMMITS_PER_REPO:-500}" -include_forks="${INPUT_INCLUDE_FORKS:-false}" -include_private="${INPUT_INCLUDE_PRIVATE:-false}" +include_forks="${INPUT_INCLUDE_FORKS:-true}" +include_private="${INPUT_INCLUDE_PRIVATE:-true}" commit_changes="${INPUT_COMMIT_CHANGES:-false}" commit_message="${INPUT_COMMIT_MESSAGE:-chore: update ghstats cards}" commit_branch="${INPUT_COMMIT_BRANCH:-}" diff --git a/main.go b/main.go index 12efedeb..00d01bf0 100644 --- a/main.go +++ b/main.go @@ -22,8 +22,8 @@ func main() { tzName = flag.String("tz", "Local", "timezone for productive-time card (IANA name, e.g. Asia/Saigon)") topRepos = flag.Int("top-repos", 0, "optional cap on seed repos probed for commit history (0 = unlimited)") perRepo = flag.Int("commits-per-repo", 500, "max commits sampled per repo (covers both last-year and all-time aggregates)") - includeForks = flag.Bool("include-forks", false, "include forked repos in stats and commit probing") - includePrivate = flag.Bool("include-private", false, "include private repos (requires PAT with repo scope)") + includeForks = flag.Bool("include-forks", true, "include forked repos in stats and commit probing") + includePrivate = flag.Bool("include-private", true, "include private repos (requires PAT with repo scope; silently no-op otherwise)") listThemes = flag.Bool("list-themes", false, "print available theme ids and exit") ) flag.Parse()