diff --git a/.github/actions/auth/bootstrap.js b/.github/actions/auth/bootstrap.js index 652b56a..d3512e8 100644 --- a/.github/actions/auth/bootstrap.js +++ b/.github/actions/auth/bootstrap.js @@ -3,22 +3,22 @@ import fs from 'node:fs' import * as url from 'node:url' -import { spawn } from 'node:child_process' +import {spawn} from 'node:child_process' -function spawnPromisified(command, args, { quiet = false, ...options } = {}) { +function spawnPromisified(command, args, {quiet = false, ...options} = {}) { return new Promise((resolve, reject) => { const proc = spawn(command, args, options) proc.stdout.setEncoding('utf8') - proc.stdout.on('data', (data) => { + proc.stdout.on('data', data => { if (!quiet) { console.log(data) } }) proc.stderr.setEncoding('utf8') - proc.stderr.on('data', (data) => { + proc.stderr.on('data', data => { console.error(data) }) - proc.on('close', (code) => { + proc.on('close', code => { if (code !== 0) { reject(code) } else { @@ -31,31 +31,32 @@ function spawnPromisified(command, args, { quiet = false, ...options } = {}) { await (async () => { // If dependencies are not vendored-in, install them at runtime. try { - await fs.accessSync( - url.fileURLToPath(new URL('./node_modules', import.meta.url)), - fs.constants.R_OK - ) + await fs.accessSync(url.fileURLToPath(new URL('./node_modules', import.meta.url)), fs.constants.R_OK) } catch { try { await spawnPromisified('npm', ['ci'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + console.error(`npm ci failed: ${error}`) process.exit(1) } } finally { + const core = await import('@actions/core') // Compile TypeScript. try { await spawnPromisified('npm', ['run', 'build'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + core.setFailed(`npm run build (TypeScript compilation) failed: ${error}`) process.exit(1) } // Run the main script. + core.info('Running auth Action index.js...') const action = await import('./dist/index.js') await action.default() } -})() \ No newline at end of file +})() diff --git a/.github/actions/file/bootstrap.js b/.github/actions/file/bootstrap.js index 652b56a..cb797fa 100644 --- a/.github/actions/file/bootstrap.js +++ b/.github/actions/file/bootstrap.js @@ -3,22 +3,22 @@ import fs from 'node:fs' import * as url from 'node:url' -import { spawn } from 'node:child_process' +import {spawn} from 'node:child_process' -function spawnPromisified(command, args, { quiet = false, ...options } = {}) { +function spawnPromisified(command, args, {quiet = false, ...options} = {}) { return new Promise((resolve, reject) => { const proc = spawn(command, args, options) proc.stdout.setEncoding('utf8') - proc.stdout.on('data', (data) => { + proc.stdout.on('data', data => { if (!quiet) { console.log(data) } }) proc.stderr.setEncoding('utf8') - proc.stderr.on('data', (data) => { + proc.stderr.on('data', data => { console.error(data) }) - proc.on('close', (code) => { + proc.on('close', code => { if (code !== 0) { reject(code) } else { @@ -31,31 +31,32 @@ function spawnPromisified(command, args, { quiet = false, ...options } = {}) { await (async () => { // If dependencies are not vendored-in, install them at runtime. try { - await fs.accessSync( - url.fileURLToPath(new URL('./node_modules', import.meta.url)), - fs.constants.R_OK - ) + await fs.accessSync(url.fileURLToPath(new URL('./node_modules', import.meta.url)), fs.constants.R_OK) } catch { try { await spawnPromisified('npm', ['ci'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + console.error(`npm ci failed: ${error}`) process.exit(1) } } finally { + const core = await import('@actions/core') // Compile TypeScript. try { await spawnPromisified('npm', ['run', 'build'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + core.setFailed(`npm run build (TypeScript compilation) failed: ${error}`) process.exit(1) } // Run the main script. + core.info('Running file Action index.js...') const action = await import('./dist/index.js') await action.default() } -})() \ No newline at end of file +})() diff --git a/.github/actions/find/bootstrap.js b/.github/actions/find/bootstrap.js index 652b56a..d86b011 100644 --- a/.github/actions/find/bootstrap.js +++ b/.github/actions/find/bootstrap.js @@ -3,22 +3,22 @@ import fs from 'node:fs' import * as url from 'node:url' -import { spawn } from 'node:child_process' +import {spawn} from 'node:child_process' -function spawnPromisified(command, args, { quiet = false, ...options } = {}) { +function spawnPromisified(command, args, {quiet = false, ...options} = {}) { return new Promise((resolve, reject) => { const proc = spawn(command, args, options) proc.stdout.setEncoding('utf8') - proc.stdout.on('data', (data) => { + proc.stdout.on('data', data => { if (!quiet) { console.log(data) } }) proc.stderr.setEncoding('utf8') - proc.stderr.on('data', (data) => { + proc.stderr.on('data', data => { console.error(data) }) - proc.on('close', (code) => { + proc.on('close', code => { if (code !== 0) { reject(code) } else { @@ -31,31 +31,32 @@ function spawnPromisified(command, args, { quiet = false, ...options } = {}) { await (async () => { // If dependencies are not vendored-in, install them at runtime. try { - await fs.accessSync( - url.fileURLToPath(new URL('./node_modules', import.meta.url)), - fs.constants.R_OK - ) + await fs.accessSync(url.fileURLToPath(new URL('./node_modules', import.meta.url)), fs.constants.R_OK) } catch { try { await spawnPromisified('npm', ['ci'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + console.error(`npm ci failed: ${error}`) process.exit(1) } } finally { + const core = await import('@actions/core') // Compile TypeScript. try { await spawnPromisified('npm', ['run', 'build'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + core.setFailed(`npm run build (TypeScript compilation) failed: ${error}`) process.exit(1) } // Run the main script. + core.info('Running find Action index.js...') const action = await import('./dist/index.js') await action.default() } -})() \ No newline at end of file +})() diff --git a/.github/actions/fix/bootstrap.js b/.github/actions/fix/bootstrap.js index 652b56a..1a86499 100644 --- a/.github/actions/fix/bootstrap.js +++ b/.github/actions/fix/bootstrap.js @@ -3,22 +3,22 @@ import fs from 'node:fs' import * as url from 'node:url' -import { spawn } from 'node:child_process' +import {spawn} from 'node:child_process' -function spawnPromisified(command, args, { quiet = false, ...options } = {}) { +function spawnPromisified(command, args, {quiet = false, ...options} = {}) { return new Promise((resolve, reject) => { const proc = spawn(command, args, options) proc.stdout.setEncoding('utf8') - proc.stdout.on('data', (data) => { + proc.stdout.on('data', data => { if (!quiet) { console.log(data) } }) proc.stderr.setEncoding('utf8') - proc.stderr.on('data', (data) => { + proc.stderr.on('data', data => { console.error(data) }) - proc.on('close', (code) => { + proc.on('close', code => { if (code !== 0) { reject(code) } else { @@ -31,31 +31,32 @@ function spawnPromisified(command, args, { quiet = false, ...options } = {}) { await (async () => { // If dependencies are not vendored-in, install them at runtime. try { - await fs.accessSync( - url.fileURLToPath(new URL('./node_modules', import.meta.url)), - fs.constants.R_OK - ) + await fs.accessSync(url.fileURLToPath(new URL('./node_modules', import.meta.url)), fs.constants.R_OK) } catch { try { await spawnPromisified('npm', ['ci'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + console.error(`npm ci failed: ${error}`) process.exit(1) } } finally { + const core = await import('@actions/core') // Compile TypeScript. try { await spawnPromisified('npm', ['run', 'build'], { cwd: url.fileURLToPath(new URL('.', import.meta.url)), - quiet: true + quiet: true, }) - } catch { + } catch (error) { + core.setFailed(`npm run build (TypeScript compilation) failed: ${error}`) process.exit(1) } // Run the main script. + core.info('Running fix Action index.js...') const action = await import('./dist/index.js') await action.default() } -})() \ No newline at end of file +})()