Skip to content

Commit

Permalink
Review console output (#115)
Browse files Browse the repository at this point in the history
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max and crazy-max authored May 14, 2021
1 parent f21a6b1 commit 0cdb8b7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
Binary file modified .github/ghaction-chocolatey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ jobs:
uses: ./
with:
args: -h
-
name: Choco install InnoSetup
uses: ./
with:
args: install innosetup --no-progress
9 changes: 6 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ async function run() {
const image = core.getInput('image') || 'ghcr.io/crazy-max/ghaction-chocolatey';

if (os.platform() == 'win32') {
core.info('🏃 Running Choco...');
core.startGroup('Running choco');
await exec.exec(`choco.exe ${args} --allow-unofficial`);
core.endGroup();
return;
}

core.info('🏃 Running Choco...');
core.startGroup('Running choco');
fs.writeFileSync('/tmp/env.txt', child_process.execSync(`env`, {encoding: 'utf8'}).trim());
await exec.exec('docker', [
'run',
Expand All @@ -35,11 +36,13 @@ async function run() {
image,
args
]);
core.endGroup();

core.info('🔨 Fixing perms...');
core.startGroup('Fixing perms');
const uid = parseInt(child_process.execSync(`id -u`, {encoding: 'utf8'}).trim());
const gid = parseInt(child_process.execSync(`id -g`, {encoding: 'utf8'}).trim());
await exec.exec('sudo', ['chown', '-R', `${uid}:${gid}`, workspace]);
core.endGroup();
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 0cdb8b7

Please sign in to comment.