Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yoanm committed Mar 19, 2024
1 parent 278f804 commit 8ec19b9
Show file tree
Hide file tree
Showing 44 changed files with 3,946 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/actions/reports-group/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node_modules
yarn-workspace-tmp
1 change: 1 addition & 0 deletions .github/actions/reports-group/create/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
1 change: 1 addition & 0 deletions .github/actions/reports-group/create/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.yarn
node_modules
2 changes: 1 addition & 1 deletion .github/actions/reports-group/create/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build: install package

.PHONY: package
package:
./node_modules/.bin/ncc build --minify --source-map --license LICENSE index.js --out dist
rm -Rf dist/* && ./node_modules/.bin/ncc build index.js --minify --source-map --license LICENSE --out dist

.PHONY: lint
lint:
Expand Down
Empty file.
8 changes: 5 additions & 3 deletions .github/actions/reports-group/create/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/reports-group/create/dist/index.js.map

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions .github/actions/reports-group/create/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import core from "@actions/core";
import io from "@actions/io";
import * as path from "path";
import * as fs from "fs";
const core = require('@actions/core'); // @TODO move to 'imports from' when moved to TS !
const io = require('@actions/io'); // @TODO move to 'imports from' when moved to TS !
const path = require('path'); // @TODO move to 'imports from' when moved to TS !
const fs = require('fs'); // @TODO move to 'imports from' when moved to TS !

import {path as pathSDK, glob as globSDK, CONSTANTS as SDK_CONSTANTS} from "node-sdk";
const {path: pathSDK, glob: globSDK, CONSTANTS: SDK_CONSTANTS} = require('./node-sdk');

async function run() {
/** INPUTS **/
Expand All @@ -16,8 +16,15 @@ async function run() {
const FOLLOW_SYMLINK_INPUT = core.getBooleanInput('follow-symbolic-links', {required: true});

/** resolve-directory **/
const groupDirectory = await core.group('Resolve group directory path', async () => path.resolve(PATH_INPUT, NAME_INPUT));
core.debug('group directory=' + groupDirectory);
const groupDirectory = await core.group(
'Resolve group directory path',
async () => {
const dir = path.resolve(PATH_INPUT, NAME_INPUT)
core.info('group directory=' + dir);

return dir;
}
);

/** resolve-files **/
const originalReportPaths = await core.group(
Expand Down Expand Up @@ -74,6 +81,7 @@ async function run() {
'Create metadata file',
async () => {
const filepath = path.join(groupDirectory, SDK_CONSTANTS.METADATA_FILENAME);
core.debug('Create metadata file at ' + filepath + ' with: ' + JSON.stringify(metadata));
fs.writeFileSync(filepath, JSON.stringify(metadata));
});

Expand Down
1 change: 1 addition & 0 deletions .github/actions/reports-group/create/node-sdk
8 changes: 5 additions & 3 deletions .github/actions/reports-group/create/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "create-gha",
"name": "create",
"private": true,
"version": "0.0.0",
"author": "yoanm",
"main": "index.js",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
"build": "make build"
},
"dependencies": {
"@actions/core": "^1.10.1",
"node-sdk": "0.1.0",
"@actions/io": "^1.1.3"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,14 @@
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==

"@actions/core@^1.10.1", "@actions/core@^1.9.1":
"@actions/core@^1.10.1":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.1.tgz#61108e7ac40acae95ee36da074fa5850ca4ced8a"
integrity sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==
dependencies:
"@actions/http-client" "^2.0.1"
uuid "^8.3.2"

"@actions/glob@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@actions/glob/-/glob-0.4.0.tgz#b169b1c1c72f41e5df7b3d9349539c88fa68403c"
integrity sha512-+eKIGFhsFa4EBwaf/GMyzCdWrXWymGXfFmZU3FHQvYS8mPcHtTtZONbkcqqUMzw9mJ/pImEBFET1JNifhqGsAQ==
dependencies:
"@actions/core" "^1.9.1"
minimatch "^3.0.4"

"@actions/http-client@^2.0.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.1.tgz#ed3fe7a5a6d317ac1d39886b0bb999ded229bb38"
Expand Down Expand Up @@ -520,7 +512,7 @@ lodash.merge@^4.6.2:
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
Expand Down
1 change: 1 addition & 0 deletions .github/actions/reports-group/find/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
2 changes: 1 addition & 1 deletion .github/actions/reports-group/find/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build: install package

.PHONY: package
package:
./node_modules/.bin/ncc build --minify --source-map --license LICENSE index.js --out dist
rm -rf dist/* && ./node_modules/.bin/ncc build index.js --minify --source-map --license LICENSE --out dist

.PHONY: lint
lint:
Expand Down
Empty file.
8 changes: 5 additions & 3 deletions .github/actions/reports-group/find/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/reports-group/find/dist/index.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions .github/actions/reports-group/find/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const core = require("@actions/core");
const {find: findSdk} = require("node-sdk");
const core = require('@actions/core'); // @TODO move to 'imports from' when moved to TS !
const {find: findSdk} = require('./node-sdk'); // @TODO move to 'imports from' when moved to TS !

async function run() {
/** INPUTS **/
Expand All @@ -10,10 +10,11 @@ async function run() {
const FOLLOW_SYMLINK_INPUT = core.getBooleanInput('follow-symbolic-links', {required: true});

/** Resolve paths **/
const groupDirPathList = findSdk.groupPaths(PATH_INPUT, {followSymbolicLinks: FOLLOW_SYMLINK_INPUT});
const groupDirPathList = await findSdk.groupPaths(PATH_INPUT, {followSymbolicLinks: FOLLOW_SYMLINK_INPUT});
if (0 === groupDirPathList.length) {
core.setFailed('Unable to retrieve any group. Something wrong most likely happened !');
}
groupDirPathList.forEach(p => core.info('Found a reports group directory at ' + p));

/** Build action output **/
core.setOutput(
Expand Down
1 change: 1 addition & 0 deletions .github/actions/reports-group/find/node-sdk
10 changes: 6 additions & 4 deletions .github/actions/reports-group/find/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "find-gha",
"name": "find",
"private": true,
"version": "0.0.0",
"author": "yoanm",
"main": "index.js",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
"build": "make build"
},
"dependencies": {
"@actions/core": "^1.10.1",
"node-sdk": "0.1.0"
"@actions/core": "^1.10.1"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1",
Expand Down
Loading

0 comments on commit 8ec19b9

Please sign in to comment.