From b7b84bdaf85ff49014e53e01dc4acd9fda0bf1e8 Mon Sep 17 00:00:00 2001 From: Jack Jackson Date: Sat, 1 Mar 2025 17:08:12 -0800 Subject: [PATCH] Lets start testing --- action.yml | 16 +++++++++ package-lock.json | 84 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 18 ++++++++++ src/index.ts | 21 ++++++++++++ tsconfig.json | 13 ++++++++ 5 files changed, 152 insertions(+) create mode 100644 action.yml create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/index.ts create mode 100644 tsconfig.json diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..16fd22f --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +name: "Commit Report Sync" +description: "Syncs a report on commits to another repository" + +inputs: + target-repo-domain: + default: "github.com" + target-repo-owner: + description: "E.g. for repo 'owner/repo', the owner is 'owner'" + required: true + target-repo-name: + description: "E.g. for repo 'owner/repo', the name is 'repo'" + required: true + +runs: + using: "node20" + main: "dist/index.js" diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7f1a309 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,84 @@ +{ + "name": "commit-report-sync", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@actions/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "requires": { + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + } + }, + "@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "requires": { + "@actions/io": "^1.0.1" + } + }, + "@actions/http-client": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", + "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", + "requires": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" + }, + "@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==" + }, + "@types/node": { + "version": "20.17.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.22.tgz", + "integrity": "sha512-9RV2zST+0s3EhfrMZIhrz2bhuhBwxgkbHEwP2gtGWPjBzVQjifMzJ9exw7aDZhR1wbpj8zBrfp3bo8oJcGiUUw==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } + }, + "@vercel/ncc": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz", + "integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==", + "dev": true + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true + }, + "undici": { + "version": "5.28.5", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", + "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", + "requires": { + "@fastify/busboy": "^2.0.0" + } + }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..854f3d8 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "commit-report-sync", + "version": "1.0.0", + "description": "Syncs a report on commits to another repository", + "main": "dist/index.js", + "scripts": { + "build": "ncc build src/index.ts -o dist", + "test": "jest" + }, + "dependencies": { + "@actions/core": "^1.10.1" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "@vercel/ncc": "^0.38.0", + "typescript": "^5.0.0" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..3ac9dc3 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,21 @@ +import * as core from '@actions/core'; + +async function run() { + try { + // Get input defined in action.yml + const exampleInput = core.getInput('example-input'); + console.log(`Input received: ${exampleInput}`); + + // Do something with the input + // ... + + // Set output + core.setOutput('example-output', 'some value'); + } catch (error) { + if (error instanceof Error) { + core.setFailed(error.message); + } + } +} + +run(); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..2783903 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "commonjs", + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "exclude": ["node_modules", "**/*.test.ts"] +} \ No newline at end of file