mirror of
https://github.com/ASzc/change-string-case-action.git
synced 2024-11-23 15:03:51 +08:00
22 lines
702 B
JavaScript
22 lines
702 B
JavaScript
const core = require('@actions/core');
|
|
const github = require('@actions/github');
|
|
|
|
try {
|
|
const inputStr = core.getInput('string');
|
|
console.log(`Manipulating string: ${inputStr}`);
|
|
|
|
const lowercase = inputStr.toLowerCase();
|
|
console.log(`lowercase: ${lowercase}`);
|
|
core.setOutput("lowercase", lowercase);
|
|
|
|
const uppercase = inputStr.toUpperCase();
|
|
console.log(`uppercase: ${uppercase}`);
|
|
core.setOutput("uppercase", uppercase);
|
|
|
|
const capitalized = inputStr.charAt(0).toUpperCase() + inputStr.slice(1).toLowerCase();
|
|
console.log(`capitalized: ${capitalized}`);
|
|
core.setOutput("capitalized", capitalized);
|
|
} catch (error) {
|
|
core.setFailed(error.message);
|
|
}
|