diff --git a/badges/coverage.svg b/badges/coverage.svg index dd7ea94..1ab0b78 100644 --- a/badges/coverage.svg +++ b/badges/coverage.svg @@ -1 +1 @@ -Coverage: 15.42%Coverage15.42% \ No newline at end of file +Coverage: 6.37%Coverage6.37% \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 7da8274..9932712 100644 --- a/dist/index.js +++ b/dist/index.js @@ -59106,6 +59106,7 @@ const io = __nccwpck_require__(7436) const core = __nccwpck_require__(2186) const { Podman } = __nccwpck_require__(1063) const { savePodmanImageCache } = __nccwpck_require__(2121) +const { fixOwner } = __nccwpck_require__(5418) async function cleanup() { try { @@ -59115,6 +59116,8 @@ async function cleanup() { const podmanContainer = podman.getContainer('podmaninpodman') await podmanContainer.remove(true) + + await fixOwner() } catch (error) { // Fail the workflow run if an error occurs core.setFailed(error.message) @@ -59492,11 +59495,10 @@ const io = __nccwpck_require__(7436) const path = __nccwpck_require__(1017) const exec = __nccwpck_require__(1514) +const tmp = path.join(process.env.RUNNER_TEMP, 'podman-in-podman-build') let temDirCreated = false async function tempDir() { - const tmp = path.join(process.env.RUNNER_TEMP, 'podman-in-podman-build') - if (!temDirCreated) { await io.mkdirP(tmp) await exec.exec(await io.which('chmod', true), ['777', tmp]) @@ -59506,7 +59508,16 @@ async function tempDir() { return tmp } -module.exports = { tempDir } +async function fixOwner() { + await exec.exec(await io.which('sudo', true), [ + 'chown', + '-R', + process.env.USER, + tmp + ]) +} + +module.exports = { tempDir, fixOwner } /***/ }), diff --git a/src/cleanup.js b/src/cleanup.js index 72d16e6..b9f003f 100644 --- a/src/cleanup.js +++ b/src/cleanup.js @@ -2,6 +2,7 @@ const io = require('@actions/io') const core = require('@actions/core') const { Podman } = require('./podman') const { savePodmanImageCache } = require('./cache') +const { fixOwner } = require('./temp') async function cleanup() { try { @@ -11,6 +12,8 @@ async function cleanup() { const podmanContainer = podman.getContainer('podmaninpodman') await podmanContainer.remove(true) + + await fixOwner() } catch (error) { // Fail the workflow run if an error occurs core.setFailed(error.message) diff --git a/src/temp.js b/src/temp.js index 47cd6ef..6330152 100644 --- a/src/temp.js +++ b/src/temp.js @@ -2,11 +2,10 @@ const io = require('@actions/io') const path = require('path') const exec = require('@actions/exec') +const tmp = path.join(process.env.RUNNER_TEMP, 'podman-in-podman-build') let temDirCreated = false async function tempDir() { - const tmp = path.join(process.env.RUNNER_TEMP, 'podman-in-podman-build') - if (!temDirCreated) { await io.mkdirP(tmp) await exec.exec(await io.which('chmod', true), ['777', tmp]) @@ -16,4 +15,13 @@ async function tempDir() { return tmp } -module.exports = { tempDir } +async function fixOwner() { + await exec.exec(await io.which('sudo', true), [ + 'chown', + '-R', + process.env.USER, + tmp + ]) +} + +module.exports = { tempDir, fixOwner }