1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-21 18:11:06 +00:00
forgejo-runner/act/runner/testdata/uses-composite-check-for-input-collision/action-with-pre-and-post/main.js
ChristopherHX cb99c53dc1
fix: composite action input pollution (#2348)
* fix: composite action input pollution

* fix run steps

* fix missing defaults in post after env cleanup

* fix test to make more sense

* Add tests and simplify change

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 54245641d28fc496152684e151043ce0c7389086)

Conflicts:
	act/runner/step_test.go
    the modified test does not exist in the Forgejo runner
2025-08-10 14:45:30 +02:00

14 lines
No EOL
386 B
JavaScript

const { appendFileSync } = require('fs');
const step = process.env['INPUT_STEP'];
appendFileSync(process.env['GITHUB_ENV'], `TEST=${step}`, { encoding:'utf-8' })
var cache = process.env['INPUT_CACHE']
try {
var cache = JSON.parse(cache)
} catch {
}
if(typeof cache !== 'boolean') {
console.log("Input Polluted boolean true/false expected, got " + cache)
process.exit(1);
}