Skip to content

Commit

Permalink
fix binary removal (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenlu authored Feb 22, 2024
1 parent 33327b0 commit c175cd3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
10 changes: 6 additions & 4 deletions migrate/apply/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10488,12 +10488,14 @@ module.exports = async function run(action) {
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
core.info(`Downloading atlas-action binary: ${url}`)
toolPath = await toolCache.downloadTool(url, 'atlas-action');
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
toolPath = 'atlas-action';
} else {
toolPath = await toolCache.downloadTool(url, 'atlas-action');
}
let cachedToolPath = await toolCache.cacheFile(toolPath, 'atlas-action', 'atlas-action', cacheVersion);
core.addPath(cachedToolPath);
// Remove the downloaded binary
fs.unlinkSync(toolPath);
toolPath = cachedToolPath;
}
fs.chmodSync(toolPath, '700'); // Assuming the binary is directly within toolPath
}
Expand Down
10 changes: 6 additions & 4 deletions migrate/lint/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10488,12 +10488,14 @@ module.exports = async function run(action) {
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
core.info(`Downloading atlas-action binary: ${url}`)
toolPath = await toolCache.downloadTool(url, 'atlas-action');
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
toolPath = 'atlas-action';
} else {
toolPath = await toolCache.downloadTool(url, 'atlas-action');
}
let cachedToolPath = await toolCache.cacheFile(toolPath, 'atlas-action', 'atlas-action', cacheVersion);
core.addPath(cachedToolPath);
// Remove the downloaded binary
fs.unlinkSync(toolPath);
toolPath = cachedToolPath;
}
fs.chmodSync(toolPath, '700'); // Assuming the binary is directly within toolPath
}
Expand Down
10 changes: 6 additions & 4 deletions migrate/push/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10488,12 +10488,14 @@ module.exports = async function run(action) {
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
core.info(`Downloading atlas-action binary: ${url}`)
toolPath = await toolCache.downloadTool(url, 'atlas-action');
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
toolPath = 'atlas-action';
} else {
toolPath = await toolCache.downloadTool(url, 'atlas-action');
}
let cachedToolPath = await toolCache.cacheFile(toolPath, 'atlas-action', 'atlas-action', cacheVersion);
core.addPath(cachedToolPath);
// Remove the downloaded binary
fs.unlinkSync(toolPath);
toolPath = cachedToolPath;
}
fs.chmodSync(toolPath, '700'); // Assuming the binary is directly within toolPath
}
Expand Down
10 changes: 6 additions & 4 deletions shim/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ module.exports = async function run(action) {
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
core.info(`Downloading atlas-action binary: ${url}`)
toolPath = await toolCache.downloadTool(url, 'atlas-action');
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
toolPath = 'atlas-action';
} else {
toolPath = await toolCache.downloadTool(url, 'atlas-action');
}
let cachedToolPath = await toolCache.cacheFile(toolPath, 'atlas-action', 'atlas-action', cacheVersion);
core.addPath(cachedToolPath);
// Remove the downloaded binary
fs.unlinkSync(toolPath);
toolPath = cachedToolPath;
}
fs.chmodSync(toolPath, '700'); // Assuming the binary is directly within toolPath
}
Expand Down

0 comments on commit c175cd3

Please sign in to comment.