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

Use Toast defaults in the GitHub action rather than hardcoded defaults #517

Merged
merged 1 commit into from
Jul 1, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/toast/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ inputs:
read_remote_cache:
description: 'Whether to read from the Docker repository for remote caching'
required: true
default: 'false'
default: ''
write_remote_cache:
description: 'Whether to write to the Docker repository for remote caching'
required: true
default: 'false'
default: ''
runs:
using: node20
main: index.js
8 changes: 4 additions & 4 deletions .github/actions/toast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const writeRemoteCacheInput = core.getInput('write_remote_cache').trim();
const tasks = tasksInput === '' ? null : tasksInput.split(/\s+/);
const file = fileInput === '' ? null : fileInput;
const dockerRepo = dockerRepoInput === '' ? null : dockerRepoInput;
const readRemoteCache = readRemoteCacheInput == 'true';
const writeRemoteCache = writeRemoteCacheInput == 'true';
const readRemoteCache = readRemoteCacheInput === '' ? null : readRemoteCacheInput.toLowerCase() === 'true';
const writeRemoteCache = writeRemoteCacheInput === '' ? null : writeRemoteCacheInput.toLowerCase() === 'true';

// Where to install Toast
const toastPrefix = process.env.HOME;
Expand All @@ -39,8 +39,8 @@ childProcess.execSync(
const taskArgs = tasks === null ? [] : tasks;
const fileArgs = file === null ? [] : ['--file', file];
const dockerRepoArgs = dockerRepo === null ? [] : ['--docker-repo', dockerRepo];
const readRemoteCacheArgs = readRemoteCache ? ['--read-remote-cache', 'true'] : [];
const writeRemoteCacheArgs = writeRemoteCache ? ['--write-remote-cache', 'true'] : [];
const readRemoteCacheArgs = readRemoteCache === null ? [] : ['--read-remote-cache', readRemoteCache.toString()];
const writeRemoteCacheArgs = writeRemoteCache === null ? [] : ['--write-remote-cache', writeRemoteCache.toString()];

// Run Toast.
try {
Expand Down