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: subpath actions via new artifact cache #2170

Merged
merged 2 commits into from
Jan 28, 2024

Conversation

ChristopherHX
Copy link
Contributor

This bug is behind a feature flag, which is good so no impact for regular users of act.

readfile have always read from action.yml and didn't passed the absolute path inside the action repo. This is fixed now, so readfile applies the subpath as prefix

Additionally the repo content has been copied into the subpath, so I applied a fix to use the trimmed actionContainer path as the code used without the feature toggle

To verify

on: push
jobs:
  _:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/cache/save@v4

using vscode debug config

        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}",
            "args": [
                "-W",
                "w.yml",
                "-P",
                "ubuntu-latest=-self-hosted",
                "--use-new-action-cache"
            ]
        }

After this fix we get

[w.yml/_] ⭐ Run Main actions/cache/save@v4
[w.yml/_]   | [warning]Key is not specified.
[w.yml/_]   ✅  Success - Main actions/cache/save@v4
[w.yml/_] Cleaning up container for job _
[w.yml/_] 🏁  Job succeeded

@ChristopherHX ChristopherHX requested a review from a team as a code owner January 28, 2024 14:46
Copy link
Contributor

github-actions bot commented Jan 28, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 2 0 0.01s
✅ REPOSITORY gitleaks yes no 2.34s
✅ REPOSITORY git_diff yes no 0.17s
✅ REPOSITORY grype yes no 7.32s
✅ REPOSITORY secretlint yes no 1.17s
✅ REPOSITORY trivy-sbom yes no 0.63s
✅ REPOSITORY trufflehog yes no 6.62s

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

Copy link

codecov bot commented Jan 28, 2024

Codecov Report

Attention: 1029 lines in your changes are missing coverage. Please review.

Comparison is base (4989f44) 61.22% compared to head (f7c4deb) 60.96%.
Report is 308 commits behind head on master.

Files Patch % Lines
pkg/artifactcache/handler.go 65.32% 103 Missing and 43 partials ⚠️
pkg/runner/run_context.go 73.37% 75 Missing and 19 partials ⚠️
pkg/runner/expression.go 55.17% 66 Missing and 12 partials ⚠️
pkg/container/docker_run.go 1.47% 66 Missing and 1 partial ⚠️
pkg/runner/action_cache.go 50.74% 49 Missing and 17 partials ⚠️
pkg/container/docker_network.go 0.00% 56 Missing ⚠️
pkg/model/planner.go 28.57% 53 Missing and 2 partials ⚠️
pkg/model/workflow.go 52.72% 42 Missing and 10 partials ⚠️
pkg/runner/reusable_workflow.go 52.47% 42 Missing and 6 partials ⚠️
pkg/common/outbound_ip.go 0.00% 44 Missing ⚠️
... and 27 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2170      +/-   ##
==========================================
- Coverage   61.22%   60.96%   -0.26%     
==========================================
  Files          46       53       +7     
  Lines        7141     8998    +1857     
==========================================
+ Hits         4372     5486    +1114     
- Misses       2462     3072     +610     
- Partials      307      440     +133     

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

@mergify mergify bot merged commit 09d4b5d into master Jan 28, 2024
10 checks passed
@mergify mergify bot deleted the new-artifact-cache-fix-subpath-actions branch January 28, 2024 16:49
jmikedupont2 pushed a commit to meta-introspector/act that referenced this pull request Mar 10, 2024
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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.

None yet

2 participants