Skip to content

Commit

Permalink
fix file permissions for log files before attempting to upload
Browse files Browse the repository at this point in the history
  • Loading branch information
qthequartermasterman authored and Jimver committed Nov 15, 2024
1 parent 28e983f commit 13f2c37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ export async function install(
const globber = await glob.create(patterns.join('\n'))
const files = await globber.glob()
if (files.length > 0) {
// If any of the files is not readable without root permissions, the upload will fail, so we need to
// fix the permissions first
for (const file of files) {
await exec(`sudo chmod 644 ${file}`)
await exec(`sudo chown $(whoami) ${file}`)
}
const rootDirectory = '/var/log'
const uploadResult = await artifact.uploadArtifact(
artifactName,
Expand Down

0 comments on commit 13f2c37

Please sign in to comment.