Skip to content

Commit

Permalink
Merge pull request #517 from stepchowfun/github-action-defaults
Browse files Browse the repository at this point in the history
Use Toast defaults in the GitHub action rather than hardcoded defaults
  • Loading branch information
stepchowfun committed Jul 1, 2024
2 parents 22fa6fd + 07457a8 commit 6c6565a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 6c6565a

Please sign in to comment.