Allow non-root container (#264)

* Allow non-root container

* format

* add lint:fix and fix lint errors

* fix tests and volume mounts
This commit is contained in:
Nikola Jokic
2025-11-21 14:44:29 +01:00
committed by GitHub
parent ad9cb43c31
commit 15e808935c
5 changed files with 63 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ describe('e2e', () => {
afterEach(async () => {
await testHelper.cleanup()
})
it('should prepare job, run script step, run container step then cleanup without errors', async () => {
await expect(
prepareJob(prepareJobData.args, prepareJobOutputFilePath)

View File

@@ -231,4 +231,20 @@ describe('Prepare job', () => {
expect(() => content.context.services[0].image).not.toThrow()
}
)
it('should prepare job with container with non-root user', async () => {
prepareJobData.args!.container!.image =
'ghcr.io/actions/actions-runner:latest' // known to use user 1001
await expect(
prepareJob(prepareJobData.args, prepareJobOutputFilePath)
).resolves.not.toThrow()
const content = JSON.parse(
fs.readFileSync(prepareJobOutputFilePath).toString()
)
expect(content.state.jobPod).toBeTruthy()
expect(content.context.container.image).toBe(
'ghcr.io/actions/actions-runner:latest'
)
})
})