Skip to content

Commit fd8fff7

Browse files
committed
Initial Commit
0 parents  commit fd8fff7

File tree

6 files changed

+387
-0
lines changed

6 files changed

+387
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
out

action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: LLS-Addons-Metadata
2+
description: |
3+
Get the metadata for LLS-Addons and save it to their info.json.
4+
inputs:
5+
GH_token:
6+
description: GitHub API Token
7+
required: true
8+
GL_token:
9+
description: GitLab API token
10+
required: true
11+
runs:
12+
using: node16
13+
main: index.js

package-lock.json

Lines changed: 302 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "lls-addons-action",
3+
"version": "0.1.0",
4+
"description": "GitHub Action for fetching LLS-Addon metadata",
5+
"main": "out/index.js",
6+
"scripts": {
7+
"build": "tsc"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/carsakiller/LLS-Addons-Action.git"
12+
},
13+
"author": "carsakiller",
14+
"license": "MIT",
15+
"bugs": {
16+
"url": "https://github.com/carsakiller/LLS-Addons-Action/issues"
17+
},
18+
"homepage": "https://github.com/carsakiller/LLS-Addons-Action#readme",
19+
"dependencies": {
20+
"@actions/core": "^1.10.0",
21+
"@actions/github": "^5.1.1",
22+
"@actions/http-client": "^2.0.1",
23+
"simple-git": "^3.16.0"
24+
},
25+
"devDependencies": {
26+
"typescript": "^4.9.4"
27+
}
28+
}

src/index.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import * as core from "@actions/core";
2+
import * as github from "@actions/github";
3+
import simpleGit from "simple-git";
4+
5+
const submoduleRegex = /([A-z0-9]+) (.*\/.*) .*/g;
6+
const submodules = [];
7+
8+
async function run() {
9+
try {
10+
const git = simpleGit();
11+
12+
const submoduleChanges = await git.diff(["--name-only"]);
13+
14+
console.log(submoduleChanges);
15+
16+
const GitHubToken = core.getInput("GH_token");
17+
const GitLabToken = core.getInput("GL_token");
18+
19+
if (!GitHubToken) throw new Error("GitHub token not specified");
20+
if (!GitLabToken) throw new Error("GitLab token not specified");
21+
22+
// const octokit = github.getOctokit(GitHubToken);
23+
} catch (error) {
24+
if (error instanceof Error) return core.setFailed(error.message);
25+
return core.setFailed(error);
26+
}
27+
}
28+
29+
run();

tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
4+
"lib": ["ESNext", "DOM"],
5+
"module": "NodeNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6+
"outDir": "./out", /* Redirect output structure to the directory. */
7+
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
8+
"strict": true, /* Enable all strict type-checking options. */
9+
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
10+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
11+
},
12+
"exclude": ["node_modules", "**/*.test.ts"]
13+
}

0 commit comments

Comments
 (0)