Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# JavaScript Action
# Node Template

Template for JavaScript Actions
Template for Node Actions
83 changes: 65 additions & 18 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4110,18 +4110,18 @@ var __copyProps = (to, from, except, desc) => {
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// pkg/dist-src/index.js
var dist_src_exports = {};
__export(dist_src_exports, {
var index_exports = {};
__export(index_exports, {
GraphqlResponseError: () => GraphqlResponseError,
graphql: () => graphql2,
withCustomRequest: () => withCustomRequest
});
module.exports = __toCommonJS(dist_src_exports);
module.exports = __toCommonJS(index_exports);
var import_request3 = __nccwpck_require__(8636);
var import_universal_user_agent = __nccwpck_require__(3843);

// pkg/dist-src/version.js
var VERSION = "7.1.0";
var VERSION = "7.1.1";

// pkg/dist-src/with-defaults.js
var import_request2 = __nccwpck_require__(8636);
Expand Down Expand Up @@ -4169,8 +4169,7 @@ function graphql(request2, query, options) {
);
}
for (const key in options) {
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
continue;
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
return Promise.reject(
new Error(
`[@octokit/graphql] "${key}" cannot be used as variable name`
Expand Down Expand Up @@ -31821,28 +31820,76 @@ module.exports = parseParams
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __nccwpck_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __nccwpck_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __nccwpck_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __nccwpck_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
/******/
/************************************************************************/
var __webpack_exports__ = {};
const core = __nccwpck_require__(7484);
const github = __nccwpck_require__(3228);
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
__nccwpck_require__.r(__webpack_exports__);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(7484);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(_actions_core__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _actions_github__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(3228);
/* harmony import */ var _actions_github__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nccwpck_require__.n(_actions_github__WEBPACK_IMPORTED_MODULE_1__);

try {
const nameToGreet = core.getInput('who-to-greet');
console.log(`Hello, ${nameToGreet}!`);

const time = (new Date()).toTimeString();
core.setOutput("time", time);

const payload = JSON.stringify(github.context.payload, undefined, 2)
console.log(`The event payload: ${payload}`);
} catch (error) {
core.setFailed(error.message);
try {
const nameToGreet = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('who-to-greet');
console.log(`Hello, ${nameToGreet}!`);
const time = (new Date()).toTimeString();
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput('time', time);
const payload = JSON.stringify(_actions_github__WEBPACK_IMPORTED_MODULE_1__.context.payload, undefined, 2);
console.log(`The event payload: ${payload}`);
}
catch (error) {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(error.message);
}

})();

module.exports = __webpack_exports__;
/******/ })()
;
29 changes: 22 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{
"name": "@actalog/javascript-action",
"name": "@actalog/node-template",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"scripts": {
"build": "ncc build src/index.js -o dist"
"build": "ncc build src/index.ts -o dist"
},
"repository": {
"type": "git",
"url": "git+https://github.com/actalog/javascript-action-template.git"
"url": "git+https://github.com/actalog/node-template.git"
},
"author": "Gabriel Rufino <contato@gabrielrufino.com>",
"license": "UNLICENSED",
"bugs": {
"url": "https://github.com/actalog/javascript-action-template/issues"
"url": "https://github.com/actalog/node-template/issues"
},
"homepage": "https://github.com/actalog/javascript-action-template#readme",
"homepage": "https://github.com/actalog/node-template#readme",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0"
},
"devDependencies": {
"@vercel/ncc": "^0.38.3"
"@vercel/ncc": "^0.38.3",
"typescript": "^5.7.3"
}
}
4 changes: 2 additions & 2 deletions src/index.js → src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const core = require('@actions/core');
const github = require('@actions/github');
import * as core from '@actions/core'
import * as github from '@actions/github'

try {
const nameToGreet = core.getInput('who-to-greet');
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"target": "es2015",
"moduleResolution": "node"
}
}
Loading