-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA][TS migration] Migrate remaining GitHub actions to TypeScript #38576
Changes from 6 commits
b11482b
a7dba17
7fd4d91
394f9df
31e8c49
16e5c0c
7648e0a
97fa360
8d36a59
3d32646
81e823f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,44 +4,6 @@ | |
/******/ (() => { // webpackBootstrap | ||
/******/ var __webpack_modules__ = ({ | ||
|
||
/***/ 1307: | ||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | ||
|
||
const _ = __nccwpck_require__(5067); | ||
const core = __nccwpck_require__(2186); | ||
const GithubUtils = __nccwpck_require__(7999); | ||
|
||
const run = function () { | ||
const artifactName = core.getInput('ARTIFACT_NAME', {required: true}); | ||
|
||
return GithubUtils.getArtifactByName(artifactName) | ||
.then((artifact) => { | ||
if (_.isUndefined(artifact)) { | ||
console.log(`No artifact found with the name ${artifactName}`); | ||
core.setOutput('ARTIFACT_FOUND', false); | ||
return; | ||
} | ||
|
||
console.log('Artifact info', artifact); | ||
core.setOutput('ARTIFACT_FOUND', true); | ||
core.setOutput('ARTIFACT_ID', artifact.id); | ||
core.setOutput('ARTIFACT_WORKFLOW_ID', artifact.workflow_run.id); | ||
}) | ||
.catch((error) => { | ||
console.error('A problem occurred while trying to communicate with the GitHub API', error); | ||
core.setFailed(error); | ||
}); | ||
}; | ||
|
||
if (require.main === require.cache[eval('__filename')]) { | ||
run(); | ||
} | ||
|
||
module.exports = run; | ||
|
||
|
||
/***/ }), | ||
|
||
/***/ 4097: | ||
/***/ ((module) => { | ||
|
||
|
@@ -13637,6 +13599,68 @@ function wrappy (fn, cb) { | |
} | ||
|
||
|
||
/***/ }), | ||
|
||
/***/ 7750: | ||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { | ||
|
||
"use strict"; | ||
|
||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", ({ value: true })); | ||
const core = __importStar(__nccwpck_require__(2186)); | ||
const GithubUtils_1 = __importDefault(__nccwpck_require__(7999)); | ||
const run = function () { | ||
const artifactName = core.getInput('ARTIFACT_NAME', { required: true }); | ||
// TODO: remove type casting once GithubUtils (https://github.com/Expensify/App/pull/38280) is migrated to TypeScript | ||
return GithubUtils_1.default.getArtifactByName(artifactName) | ||
.then((artifact) => { | ||
if (artifact === undefined) { | ||
console.log(`No artifact found with the name ${artifactName}`); | ||
core.setOutput('ARTIFACT_FOUND', false); | ||
return; | ||
} | ||
console.log('Artifact info', artifact); | ||
core.setOutput('ARTIFACT_FOUND', true); | ||
core.setOutput('ARTIFACT_ID', artifact.id); | ||
core.setOutput('ARTIFACT_WORKFLOW_ID', artifact.workflow_run?.id); | ||
}) | ||
.catch((error) => { | ||
console.error('A problem occurred while trying to communicate with the GitHub API', error); | ||
core.setFailed(error); | ||
}); | ||
}; | ||
if (require.main === require.cache[eval('__filename')]) { | ||
run(); | ||
} | ||
exports["default"] = run; | ||
|
||
|
||
/***/ }), | ||
|
||
/***/ 2877: | ||
|
@@ -16000,7 +16024,7 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"] | |
/******/ // startup | ||
/******/ // Load entry module and return exports | ||
/******/ // This entry module is referenced by other modules so it can't be inlined | ||
/******/ var __webpack_exports__ = __nccwpck_require__(1307); | ||
/******/ var __webpack_exports__ = __nccwpck_require__(7750); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for my ignorance. Can you explain to me why this changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is auto-generated so I don't know the exact reason behind that change, but my guess is this might be due to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh I see. |
||
/******/ module.exports = __webpack_exports__; | ||
/******/ | ||
/******/ })() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we define our own typings for
GithubUtils
in the meanwhile?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean, could you provide more details? 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you familiar with ambient typings and
.d.ts
files?In general, typings can be provided by any party. Either the original third-party library itself (let's say
foo
), another third-party library (like@types/foo
), or the project that depends onfoo
itself.I'm not sure if there's any difficulty with using ambient typings with GitHub actions specifically, I only used them in "typical" TypeScript projects, but I would assume it's possible.
We can give up if this becomes too time-consuming, but I'd give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I did it for some other modules, great idea! Actually GithubUtils PR got merged a couple hours ago so the problem is not valid anymore!