feat(rockcraft-pack): accept env-file input - #39
Conversation
lengau
left a comment
There was a problem hiding this comment.
Giving this a tentative yes because it seems fine, but I have an entire lack of confidence in my typescript knowledge.
| if (this.envFile) { | ||
| sourceCmd = `source ${this.envFile} && `; | ||
| } | ||
| const bashCommand = `${sourceCmd}sudo --preserve-env --user ${shellUser()} ${rockcraft}`; |
There was a problem hiding this comment.
This is unrelated to the PR, but this is an interesting example of where switching to sudo-rs could cause issues.
Co-authored-by: Callahan <callahan.kovacs@canonical.com>
There was a problem hiding this comment.
Pull Request Overview
This PR enables the rockcraft-pack action to accept an optional env-file input, which is sourced before running the Rockcraft pack command.
- Adds a new
envFileproperty throughout the builder, action, and tests - Updates
exec.execto run viabash -c, optionally prefixing withsource <env-file> - Extends action metadata and adjusts workflow tests accordingly
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rockcraft-pack.test.ts | Add envFile input to test cases and update expected execMock calls |
| src/rockcraft-pack.ts | Introduce envFile in options and source the file before pack command |
| src/rockcraft-pack-action.ts | Retrieve env-file input and forward to RockcraftBuilder |
| rockcraft-pack/action.yml | Declare new env-file input in action metadata |
| .github/workflows/test.yml | Update CI matrix by removing Ubuntu 20.04 |
Comments suppressed due to low confidence (1)
.github/workflows/test.yml:35
- Dropping Ubuntu 20.04 from the matrix reduces platform coverage; consider retaining it if still supported.
os: [ubuntu-24.04, ubuntu-22.04]
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@cjdcordeiro I'm fine with this PR, but it's in Draft and has a missing test. Just pointing this out in case it dropped off your radar |
|
Thanks @tigarmo . I moved this to Draft because after an internal discussion we had. Let me ping you there and feel free to close this PR if you agree that this is not needed after all |
Let the
rockcraft-packaction accept an optional input to specify the execution environment to be sourced before running Rockcraft.