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

fix: composite action input pollution #2348

Merged
merged 6 commits into from
Jun 5, 2024
Merged

Conversation

ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Jun 3, 2024

The full shape of this bug not yet discovered, it's big and needs tests

and act refuses to use the default for an nodejs input when an composite action has an input with the same name

Fixes #2243

Copy link
Contributor

github-actions bot commented Jun 3, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 4 0 0.02s
✅ REPOSITORY gitleaks yes no 2.38s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY grype yes no 7.7s
✅ REPOSITORY secretlint yes no 1.32s
✅ REPOSITORY trivy-sbom yes no 0.64s
✅ REPOSITORY trufflehog yes no 4.3s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@ChristopherHX
Copy link
Contributor Author

My outstanding task here is writing tests, please remind me if I forget that.

Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.31%. Comparing base (5a80a04) to head (885a7b9).
Report is 79 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2348       +/-   ##
===========================================
+ Coverage   61.56%   76.31%   +14.75%     
===========================================
  Files          53       61        +8     
  Lines        9002     7811     -1191     
===========================================
+ Hits         5542     5961      +419     
+ Misses       3020     1295     -1725     
- Partials      440      555      +115     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pull-request-size pull-request-size bot added size/L and removed size/S labels Jun 4, 2024
@ChristopherHX ChristopherHX marked this pull request as ready for review June 4, 2024 19:35
@ChristopherHX ChristopherHX requested a review from a team as a code owner June 4, 2024 19:35
@@ -625,6 +625,7 @@ func runPostStep(step actionStep) common.Executor {
case model.ActionRunsUsingNode12, model.ActionRunsUsingNode16, model.ActionRunsUsingNode20:

populateEnvsFromSavedState(step.getEnv(), step, rc)
populateEnvsFromInput(ctx, step.getEnv(), step.getActionModel(), rc)
Copy link
Contributor Author

@ChristopherHX ChristopherHX Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaning up env caused missing default values in post steps

@@ -242,6 +242,8 @@ func TestRunEvent(t *testing.T) {
// Uses
{workdir, "uses-composite", "push", "", platforms, secrets},
{workdir, "uses-composite-with-error", "push", "Job 'failing-composite-action' failed", platforms, secrets},
{workdir, "uses-composite-check-for-input-collision", "push", "", platforms, secrets},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test only passes via changes made here

@@ -139,6 +139,7 @@ func TestSetupEnv(t *testing.T) {
JobContainer: cm,
}
step := &model.Step{
Uses: "./",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if step.getStepModel().Uses != "" { check above, empty with doesn't mean it's a run step

Copy link
Contributor

@cplee cplee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChristopherHX - I appreciate the comments on the PR. Makes it easier to understand intentions!

@mergify mergify bot merged commit b5ad3c4 into master Jun 5, 2024
11 checks passed
@mergify mergify bot deleted the fix-composite-input-pollution branch June 5, 2024 14:44
@ChristopherHX
Copy link
Contributor Author

Errata of this PR is #2426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting "Caching for 'false' is not supported" error when using 3rd party action
2 participants