Skip to content

Fix use of safe.directory inside containers - #1768

Merged
thomasrockhu-codecov merged 4 commits into
codecov:mainfrom
Flamefire:patch-1
Feb 18, 2025
Merged

thomasrockhu-codecov merged 4 commits into
codecov:mainfrom
Flamefire:patch-1

Conversation

@Flamefire

@Flamefire Flamefire commented Feb 15, 2025 •

Copy link
Copy Markdown
Contributor

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.
Comment thread action.yml
Comment thread action.yml Outdated
@Flamefire

Copy link
Copy Markdown
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}}

Comment thread action.yml Outdated
@thomasrockhu-codecov

Copy link
Copy Markdown
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
Copy Markdown
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
@codecov

codecov Bot commented Feb 18, 2025

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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