Skip to content

Commit

Permalink
shim: fixed tool cache location (#185)
Browse files Browse the repository at this point in the history
* shim: fixed tool cache location

* all: update shim code
  • Loading branch information
giautm authored Jul 2, 2024
1 parent 2b61932 commit 56fcdc1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
5 changes: 4 additions & 1 deletion migrate/apply/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10486,7 +10486,9 @@ module.exports = async function run(action) {
const cacheVersion = `${semver.coerce(version).version}-${process.env.GITHUB_RUN_ID}-${process.env.GITHUB_RUN_ATTEMPT}`;
const url = `https://release.ariga.io/atlas-action/atlas-action-${version}`;
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
if (toolPath) {
core.addPath(toolPath);
} else {
core.info(`Downloading atlas-action binary: ${url}`)
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
Expand Down Expand Up @@ -10517,6 +10519,7 @@ module.exports = async function run(action) {
}
}


/***/ }),

/***/ 9491:
Expand Down
5 changes: 4 additions & 1 deletion migrate/down/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10486,7 +10486,9 @@ module.exports = async function run(action) {
const cacheVersion = `${semver.coerce(version).version}-${process.env.GITHUB_RUN_ID}-${process.env.GITHUB_RUN_ATTEMPT}`;
const url = `https://release.ariga.io/atlas-action/atlas-action-${version}`;
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
if (toolPath) {
core.addPath(toolPath);
} else {
core.info(`Downloading atlas-action binary: ${url}`)
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
Expand Down Expand Up @@ -10517,6 +10519,7 @@ module.exports = async function run(action) {
}
}


/***/ }),

/***/ 9491:
Expand Down
5 changes: 4 additions & 1 deletion migrate/lint/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10486,7 +10486,9 @@ module.exports = async function run(action) {
const cacheVersion = `${semver.coerce(version).version}-${process.env.GITHUB_RUN_ID}-${process.env.GITHUB_RUN_ATTEMPT}`;
const url = `https://release.ariga.io/atlas-action/atlas-action-${version}`;
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
if (toolPath) {
core.addPath(toolPath);
} else {
core.info(`Downloading atlas-action binary: ${url}`)
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
Expand Down Expand Up @@ -10517,6 +10519,7 @@ module.exports = async function run(action) {
}
}


/***/ }),

/***/ 9491:
Expand Down
5 changes: 4 additions & 1 deletion migrate/push/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10486,7 +10486,9 @@ module.exports = async function run(action) {
const cacheVersion = `${semver.coerce(version).version}-${process.env.GITHUB_RUN_ID}-${process.env.GITHUB_RUN_ATTEMPT}`;
const url = `https://release.ariga.io/atlas-action/atlas-action-${version}`;
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
if (toolPath) {
core.addPath(toolPath);
} else {
core.info(`Downloading atlas-action binary: ${url}`)
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
Expand Down Expand Up @@ -10517,6 +10519,7 @@ module.exports = async function run(action) {
}
}


/***/ }),

/***/ 9491:
Expand Down
5 changes: 4 additions & 1 deletion migrate/test/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10486,7 +10486,9 @@ module.exports = async function run(action) {
const cacheVersion = `${semver.coerce(version).version}-${process.env.GITHUB_RUN_ID}-${process.env.GITHUB_RUN_ATTEMPT}`;
const url = `https://release.ariga.io/atlas-action/atlas-action-${version}`;
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
if (toolPath) {
core.addPath(toolPath);
} else {
core.info(`Downloading atlas-action binary: ${url}`)
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
Expand Down Expand Up @@ -10517,6 +10519,7 @@ module.exports = async function run(action) {
}
}


/***/ }),

/***/ 9491:
Expand Down
5 changes: 4 additions & 1 deletion schema/test/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10486,7 +10486,9 @@ module.exports = async function run(action) {
const cacheVersion = `${semver.coerce(version).version}-${process.env.GITHUB_RUN_ID}-${process.env.GITHUB_RUN_ATTEMPT}`;
const url = `https://release.ariga.io/atlas-action/atlas-action-${version}`;
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
if (toolPath) {
core.addPath(toolPath);
} else {
core.info(`Downloading atlas-action binary: ${url}`)
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
Expand Down Expand Up @@ -10517,6 +10519,7 @@ module.exports = async function run(action) {
}
}


/***/ }),

/***/ 9491:
Expand Down
6 changes: 4 additions & 2 deletions shim/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ module.exports = async function run(action) {
const cacheVersion = `${semver.coerce(version).version}-${process.env.GITHUB_RUN_ID}-${process.env.GITHUB_RUN_ATTEMPT}`;
const url = `https://release.ariga.io/atlas-action/atlas-action-${version}`;
toolPath = toolCache.find('atlas-action', cacheVersion);
if (!toolPath) {
if (toolPath) {
core.addPath(toolPath);
} else {
core.info(`Downloading atlas-action binary: ${url}`)
// check if the binary is already in 'atlas-action' file
if (fs.existsSync('atlas-action')) {
Expand Down Expand Up @@ -63,4 +65,4 @@ module.exports = async function run(action) {
core.setFailed(`The process exited with code ${exitCode}`);
process.exit(exitCode);
}
}
}

0 comments on commit 56fcdc1

Please sign in to comment.