Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review console output #115

Merged
merged 1 commit into from May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified .github/ghaction-chocolatey.png
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
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