Add js_action.yaml

This commit is contained in:
Hang Cui
2025-10-22 15:40:45 -07:00
parent b09b3e038f
commit a36f405466
526 changed files with 191767 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
const core = require('@actions/core');
const github = require('@actions/github');
const fs = require('fs');
try {
// name is from action.yaml (the input)
const name = core.getInput('name');
console.log(`Arg received from index.js: ${name}`);
console.log('Workdir from index.js:');
fs.readdirSync('.').forEach(file => {
console.log(file);
});
// This is how we can get the github context in the action
const payload = JSON.stringify(github.context.payload, undefined, 2);
console.log(`The event payload: ${payload}`);
fs.writeFileSync('name.txt', name);
core.setOutput('processed-name', name);
} catch (error) {
core.setFailed(error.message);
}