From 6f87bc2b60f4eb251775aa32809e7ce8f6ce41ed Mon Sep 17 00:00:00 2001 From: Bryan Hundven Date: Mon, 13 Nov 2023 12:46:56 -0800 Subject: [PATCH] Fix debian install shellcheck (#15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 💌 Description This change fixes a bug with the [act](https://github.com/nektos/act) tool. ``` [CI/test] 💬 ::debug::shellcheck exists: false | [command]/usr/bin/sudo apt-get install shellcheck | sudo: unable to send audit message: Operation not permitted | Reading package lists... | Building dependency tree... | Reading state information... | E: Unable to locate package shellcheck | Error: The process '/usr/bin/sudo' failed with exit code 100 | at ExecState._setResult (/run/act/actions/actions-github-script@v6/dist/index.js:1702:25) | at ExecState.CheckComplete (/run/act/actions/actions-github-script@v6/dist/index.js:1685:18) | at ChildProcess. (/run/act/actions/actions-github-script@v6/dist/index.js:1579:27) | at ChildProcess.emit (node:events:517:28) | at maybeClose (node:internal/child_process:1098:16) | at ChildProcess._handle.onexit (node:internal/child_process:303:5) [CI/test] ❗ ::error::Unhandled error: Error: The process '/usr/bin/sudo' failed with exit code 100 [CI/test] ❌ Failure - Main Install tool dependencies [CI/test] exitcode '1': failure [CI/test] ⚙ ::set-output:: exit-code= [CI/test] ⚙ ::set-output:: exit-message= [CI/test] ⚙ ::set-output:: total-errors= [CI/test] ⚙ ::set-output:: total-files= [CI/test] ⚙ ::set-output:: cache-hit=false [CI/test] ⚙ ::set-output:: version-semver=1.6.26 [CI/test] ⚙ ::set-output:: version-tag=v1.6.26 [CI/test] ❌ Failure - Main actionlint [CI/test] exitcode '1': failure ``` Basically, the debian package database is empty, so you need to run `apt-get update` first. It's also nice to set the `DEBIAN_FRONTEND` environment variable to `noninteractive` to not get weird warnings. ## 🔗 Related issue ## 🏗️ Type of change - [ ] 📚 Examples / docs / tutorials - [x] 🐛 Bug fix (non-breaking change which fixes an issue) - [x] 🥂 Improvement (non-breaking change which improves an existing feature) - [ ] 🚀 New feature (non-breaking change which adds functionality) - [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🚨 Security fix - [ ] ⬆️ Dependencies update ## ✅ Checklist - [x] I've read the [`Code of Conduct`](https://github.com/raven-actions/actionlint/blob/main/.github/CODE_OF_CONDUCT.md)> document. - [x] I've read the [`Contributing`](https://github.com/raven-actions/actionlint/blob/main/.github/CONTRIBUTING.md) guide. Signed-off-by: Bryan Hundven --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index b0411bc..f6b7e4b 100644 --- a/action.yml +++ b/action.yml @@ -285,6 +285,8 @@ runs: await exec.exec('brew', ['install', 'shellcheck']) break; case 'linux': + core.exportVariable('DEBIAN_FRONTEND', 'noninteractive') + await exec.exec('sudo apt-get update') await exec.exec('sudo apt-get install shellcheck') break; case 'win32':