chore: bump gha-utils from 0.2.0 to 0.3.0 (#446)

Bumps [gha-utils](https://github.com/threeal/gha-utils) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/threeal/gha-utils/releases)
- [Commits](https://github.com/threeal/gha-utils/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: gha-utils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfi Maulana <alfi.maulana.f@gmail.com>
This commit is contained in:
dependabot[bot] 2024-09-19 23:59:36 +08:00 committed by GitHub
parent 0ed19852bd
commit d62c3d86bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 12 deletions

28
dist/action.mjs generated vendored
View File

@ -1,8 +1,23 @@
import fs from 'node:fs';
import 'node:fs';
import fsPromises from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import { execFileSync } from 'node:child_process';
/**
* Retrieves the value of an environment variable.
*
* @param name - The name of the environment variable.
* @returns The value of the environment variable.
* @throws Error if the environment variable is not defined.
*/
function mustGetEnvironment(name) {
const value = process.env[name];
if (value === undefined) {
throw new Error(`the ${name} environment variable must be defined`);
}
return value;
}
/**
* Retrieves the value of a GitHub Actions input.
*
@ -17,11 +32,14 @@ function getInput(name) {
* Sets the value of a GitHub Actions output.
*
* @param name - The name of the GitHub Actions output.
* @param value - The value of the GitHub Actions output
* @param value - The value to set for the GitHub Actions output.
* @returns A promise that resolves when the value is successfully set.
*/
function setOutput(name, value) {
fs.appendFileSync(process.env["GITHUB_OUTPUT"], `${name}=${value}${os.EOL}`);
async function setOutput(name, value) {
const filePath = mustGetEnvironment("GITHUB_OUTPUT");
await fsPromises.appendFile(filePath, `${name}=${value}${os.EOL}`);
}
/**
* Logs an error message in GitHub Actions.
*
@ -109,7 +127,7 @@ function getContext() {
try {
const context = getContext();
configureProject(context);
setOutput("build-dir", context.buildDir);
await setOutput("build-dir", context.buildDir);
if (context.build.enabled) {
buildProject(context);
}

View File

@ -9,7 +9,7 @@
"test": "jest"
},
"dependencies": {
"gha-utils": "^0.2.0"
"gha-utils": "^0.3.0"
},
"devDependencies": {
"@eslint/js": "^9.10.0",

View File

@ -7,7 +7,7 @@ try {
configureProject(context);
setOutput("build-dir", context.buildDir);
await setOutput("build-dir", context.buildDir);
if (context.build.enabled) {
buildProject(context);

10
yarn.lock generated
View File

@ -2376,10 +2376,10 @@ __metadata:
languageName: node
linkType: hard
"gha-utils@npm:^0.2.0":
version: 0.2.0
resolution: "gha-utils@npm:0.2.0"
checksum: 10c0/34e597b9011518c36abbb4bbbfb0ecaf16171e2bafad3a9ddbbdd3c3b2c1234eb8afc06fc84837565afca5e9ca9d48eb62a7238613ab808d8e1c7e0b6651e2c6
"gha-utils@npm:^0.3.0":
version: 0.3.0
resolution: "gha-utils@npm:0.3.0"
checksum: 10c0/f8fe13abc48640d60072518260c8e6d5fb695e933c3ef2e16970838d3676254d21ed239e4267ae65f83dc5c167a1bd97959005b713217ead7bf8873e79b2343b
languageName: node
linkType: hard
@ -4108,7 +4108,7 @@ __metadata:
"@types/jest": "npm:^29.5.13"
"@types/node": "npm:^22.5.5"
eslint: "npm:^9.9.1"
gha-utils: "npm:^0.2.0"
gha-utils: "npm:^0.3.0"
jest: "npm:^29.7.0"
prettier: "npm:^3.3.3"
rollup: "npm:^4.21.3"