21 Commits
Author SHA1 Message Date
w4ffl35 a0e5e8d8f5 Avoid persisting checkout credentials (#44) 2026-11-09 16:44:22 +06:00
DmitriyLewen 81e514348e fix: remove literal ${{ runner.temp }} that breaks action loading (#38)
* fix: remove literal ${{ runner.temp }} from action.yaml

GitHub evaluates all ${{ }} expressions in action.yaml, including inside
input descriptions where the `runner` context is unavailable. The literal
${{ runner.temp }} in the `path` description made the action fail to load
with "Unrecognized named-value: 'runner'", breaking every consumer of
v0.3.0 regardless of whether `path` was set.

Fixes #37

* test: add CI workflow exercising the action

Run the action on ubuntu/windows/macos (defaults, cache, custom path) and
assert that an invalid `path` is rejected. Actually using the action via
`uses: ./` catches load-time errors like #37 that static linters miss.

* test: use Trivy v0.71.0 in CI workflow

v0.68.2 has no release assets, so the install step 404s. v0.71.0 (the version
from #37) downloads correctly.

* test: add positive control to reject-invalid-path job

The job asserted only that the install step failed, so it stayed green even
when the action failed to load entirely (the #37 regression). Add a control
step that installs with a valid path and must succeed, so the job can only
pass when the action loads and then rejects the invalid paths.
v0.3.1
2026-06-03 18:03:56 +06:00
151a37f29c fix!: prevent script injection in run blocks (#33)
* fix: prevent script injection in run blocks

Use env variables instead of direct ${{ }} interpolation in shell
commands to prevent script injection vulnerabilities.

* fix: quote $GITHUB_OUTPUT and $GITHUB_PATH to prevent word splitting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use shell fallback for default path to ensure $HOME expansion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: validate path input to fail early on unexpanded shell variables

Since `path` is passed via env to prevent script injection, shell
variables and `~` inside it are not expanded. Reject such inputs with a
clear error instead of silently creating a directory literally named
`$HOME`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: reject newlines in path input and document literal-path requirement

- switch `path` validation to a `case` block and reject newline/CR to
  prevent injecting extra lines into $GITHUB_OUTPUT (output poisoning)
- reject `~` anywhere, not only as a prefix, for consistency
- document the literal-path requirement in the `path` input description
  and README (use ${{ runner.temp }}, not $RUNNER_TEMP)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: DmitriyLewen <dmitriy.lewen@smartforce.io>
v0.3.0
2026-06-02 18:03:24 +06:00
Tomochika Hara 3fb12ec12f Pin Trivy install script checkout to a specific commit (#28) v0.2.6 2026-01-15 16:21:20 +06:00
DmitriyLewen 9cf04f1f4f docs: use commit SHA and update Trivy version to v0.68.2: (#26) 2026-01-13 12:31:38 +06:00
DmitriyLewenandafdesk e07451d2e0 ci: use restore and save instead of actions/cache (#19)
Co-authored-by: afdesk <work@afdesk.com>
2026-01-12 16:02:46 +06:00
DmitriyLewen a451008577 chore(deps): bump actions version (#25) 2026-01-12 15:45:31 +06:00
Owen Rumney 271d4ea1cb chore: use the -c flag on install script (#24) 2025-12-19 16:12:16 +06:00
Stefan Melmuk e6c2c5e321 pin actions/checkout and actions/cache (#22) 2025-08-29 11:24:37 +06:00
DmitriyLewen 9ea583eb67 docs: bump setup-trivy version from v0.2.2 to v0.2.3 (#17) 2025-04-09 11:14:05 +06:00
Dominic Evans f932d6a320 feat: permit override for github-server-url via input (#16) 2025-04-09 10:59:24 +06:00
DmitriyLewen ff1b8b060f docs: bump setup-trivy version (#14) 2024-10-24 11:34:10 +06:00
DmitriyLewen e71d901c19 feat: add token input and pin github-server-url (#12)
* feat: add `token` input and pin `github-server-url`

* fix: use `${{ github.token }}` as default value for token

* docs: add info about token in README.md

* docs: bump Trivy version
2024-10-24 11:30:53 +06:00
DmitriyLewen 5ef739fe4f fix: add contrib dir (#13)
* feat: copy `contrib` dir into `<path>/trivy-bin`

* fix: use `-r` for remove `trivy` repo

* refactor: remove extra line
2024-10-23 10:53:29 +06:00
Rob Vesse a8e37c47fe fix: Remove Trivy installation script (#9) (#11)
As Trivy checks out its installation script into the same directory as
the workflow users own code is typically checked out into this can cause
other linters/checks that a workflow is using to fail due to the
unexpected install script being present.  This commit modifies the
action to ensure that the installation script is removed after the
action has installed trivy.
2024-10-17 15:15:25 +06:00
simar7 eadb05c36f fix: remove backticks from error message (#8) 2024-10-15 09:48:20 +06:00
DmitriyLewen 7483281e21 refactor: use git + install script (#5)
* refactor: use `git` + install script

* docs: update README.md

* docs: use `v0.2.0` version in README.md

* docs: refactor
2024-10-14 12:14:05 +04:00
simar7 8b3109d80d docs: Add clarification for caching (#3) 2024-10-10 10:17:02 +06:00
DmitriyLewen 6202263cf9 docs: use v0.1.0 in README.md (#2) 2024-10-09 14:02:21 +04:00
DmitriyLewen 5d23e51754 feat: add action.yaml to install Trivy (#1)
* feat: add `action.yaml` to install Trivy from release page

* feat: fix typo (inputs)

* fix: update message about latest tag + cache

* refactor: disable cache by default

* docs: update README.md
2024-10-09 13:45:52 +04:00
Teppei Fukuda 2787c0644b Initial commit 2024-10-09 11:29:17 +04:00