Tweak
This commit is contained in:
@@ -1,18 +1,17 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the message input parameter, with a default fallback
|
// Get the message input parameter, with a default fallback
|
||||||
const message = core.getInput('message') || 'Hello from Pullfrog Action!';
|
const message = core.getInput("message") || "Hello from Pullfrog Action!";
|
||||||
|
|
||||||
// Print the message to console and GitHub Actions logs
|
// Print the message to console and GitHub Actions logs
|
||||||
console.log(`🐸 Pullfrog says: ${message}`);
|
console.log(`🐸 Pullfrog says: ${message}`);
|
||||||
core.info(`Action executed successfully with message: ${message}`);
|
core.info(`Action executed successfully with message: ${message}`);
|
||||||
|
|
||||||
// Set an output for potential use by other actions
|
// Set an output for potential use by other actions
|
||||||
core.setOutput('message', message);
|
core.setOutput("message", message);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Handle any errors and fail the action
|
// Handle any errors and fail the action
|
||||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
||||||
core.setFailed(`Action failed: ${errorMessage}`);
|
core.setFailed(`Action failed: ${errorMessage}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user