Skip to content

Commit

Permalink
Review console output
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed May 14, 2021
1 parent f21a6b1 commit bdf7434
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
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
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 bdf7434

Please sign in to comment.