Skip to content
This repository was archived by the owner on Mar 1, 2022. It is now read-only.

Commit 542aa57

Browse files
Add a few fixes
- Split out build `npm` scripts - Pass correct repository URL
1 parent 185e2a2 commit 542aa57

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

lib/main.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,7 @@ const camelcase_keys_1 = __importDefault(require("camelcase-keys"));
1818
const DEPLOYS_URL = process.env.VELOCITY_DEPLOYS_URL || "https://velocity.codeclimate.com/deploys";
1919
const GITHUB_EVENT_PATH = process.env.GITHUB_EVENT_PATH;
2020
const readEvent = () => camelcase_keys_1.default(JSON.parse(fs_1.readFileSync(GITHUB_EVENT_PATH, "utf8")));
21-
const report = (deploy) => axios_1.default.post(DEPLOYS_URL, snakecase_keys_1.default({
22-
branch: deploy.branch,
23-
environment: deploy.environment,
24-
revision: deploy.revision,
25-
version: deploy.version,
26-
repositoryUrl: "foo",
27-
token: process.env.VELOCITY_DEPLOYMENT_TOKEN,
28-
}));
21+
const report = (deploy) => axios_1.default.post(DEPLOYS_URL, snakecase_keys_1.default(Object.assign({}, deploy, { token: process.env.VELOCITY_DEPLOYMENT_TOKEN })));
2922
const main = () => {
3023
try {
3124
const event = readEvent();

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"scripts": {
3-
"build": "tsc"
3+
"build:dev": "npm install && tsc",
4+
"build:production": "npm run-script build:dev && npm prune --production"
45
},
56
"dependencies": {
67
"@actions/core": "file:toolkit/actions-core-0.0.0.tgz",

src/main.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ const report = (deploy: Deploy): Promise<AxiosResponse<any>> =>
2323
axios.post(
2424
DEPLOYS_URL,
2525
snake({
26-
branch: deploy.branch,
27-
environment: deploy.environment,
28-
revision: deploy.revision,
29-
version: deploy.version,
30-
repositoryUrl: "foo",
26+
...deploy,
3127
token: process.env.VELOCITY_DEPLOYMENT_TOKEN,
3228
})
3329
)

0 commit comments

Comments
 (0)