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 use of safe.directory inside containers #1768

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Feb 15, 2025

Inside a container the actual workspace path is a mount point and not the same as outside the container. E.g.:

  • ${{github.workspace}} == /home/runner/work/locale/locale
  • $GITHUB_WORKSPACE == /__w/locale/locale

So it seems /home/runner/work is mounted at /__w and this is reflected by the environment variable but not the context. So use that variable instead.

Fixes #1767

Inside a container the actual workspace path is a mount point and not the same as outside the container.
E.g.:
- `${{github.workspace}} == /home/runner/work/locale/locale`
- `$GITHUB_WORKSPACE == /__w/locale/locale`

So it seems `/home/runner/work` is mounted at `/__w` and this is reflected by the environment variable but not the context.   
So use that variable instead.
@Flamefire
Copy link
Contributor Author

@thomasrockhu-codecov Your change breaks this: $GITHUB_WORKSPACE is an environment variable not a context. And only the environment variable contains the value of the path inside the container, if one is used. Without a container it is the same as the context variable ${{github.workspace}}

@thomasrockhu-codecov
Copy link
Contributor

@Flamefire can you link a PR with $GITHUB_WORKSPACE being filled in in a container? https://github.com/codecov/codecov-action/actions/runs/13388562452/job/37391004360?pr=1768#step:5:32

@Flamefire
Copy link
Contributor Author

I had a test at #1767 (comment)
IIRC this was from https://github.com/boostorg/locale/actions/runs/13347288978/job/37279295461

Scroll to "Debug coverage" and see the output:

Canonical: /home/runner/work/locale/locale /__w/locale/locale

This is from https://github.com/boostorg/locale/blob/456e6e7be28c5e82b99b767ab2e48bebf470a8c0/.github/workflows/ci.yml#L371

@thomasrockhu-codecov thomasrockhu-codecov merged commit 2e6e9c5 into codecov:main Feb 18, 2025
8 checks passed
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (4898080) to head (5e61ec8).
Report is 2 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #1768   +/-   ##
============================
============================

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

@Flamefire Flamefire deleted the patch-1 branch February 18, 2025 11:30
@Flamefire
Copy link
Contributor Author

Thank you for merging this! Is there any estimate for the next release? Then I'd rerun my job(s) using the action

@thomasrockhu-codecov
Copy link
Contributor

@Flamefire some time this week, likely today or tomorrow

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

Successfully merging this pull request may close these issues.

[BUG] Unexpected working directory since recent update
2 participants