Skip to content

Commit cd6340f

Browse files
✨ change verify to command
1 parent 3865236 commit cd6340f

8 files changed

Lines changed: 37 additions & 44 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Bit Verify
1+
name: Test Bit Command
22
on:
33
workflow_dispatch:
44
jobs:
@@ -14,4 +14,6 @@ jobs:
1414
with:
1515
ws-dir: 'test-data'
1616
- name: Bit Verify
17-
uses: bit-tasks/verify@main
17+
uses: vturb/bit-command@main
18+
with:
19+
cmd: status --strict

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Bit Verify
1+
name: Release Bit Command
22
on:
33
workflow_dispatch:
44
push:

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Bit Verify Components for CI/CD Pipelines
2-
Check Bit components for issues in a Bit workspace.
1+
# Bit Command for CI/CD Pipelines
2+
Execute Bit command in a Bit workspace.
33

44
# GitHub Actions
55

6-
This task executes `bit status --strict && bit build` inside the workspace directory.
6+
This task executes `bit ${cmd}` inside the workspace directory.
77

88
## Inputs
99

10-
### `ws-dir`
10+
### `cmd`
1111

12-
**Optional** The workspace directory path from the root. Default `"Dir specified in Init Task or ./"`.
12+
**Required** The command to execute in bit workspace.
1313

14-
### `skip-build`
14+
### `ws-dir`
1515

16-
**Optional** Skip running `bit build` in the action.
16+
**Optional** The workspace directory path from the root. Default `"Dir specified in Init Task or ./"`.
1717

1818
## Example usage
1919

20-
**Note:** Use `bit-task/init@v1` as a prior step in your action before running `bit-tasks/verify@v1`.
20+
**Note:** Use `bit-task/init@v1` as a prior step in your action before running `vturb/bit-command@v1`.
2121

2222
```yaml
23-
name: Test Bit Verify
23+
name: Test Bit Command
2424
on:
2525
workflow_dispatch:
2626
jobs:
@@ -36,10 +36,10 @@ jobs:
3636
uses: actions/checkout@v3
3737
- name: Initialize Bit
3838
uses: bit-tasks/init@v1
39+
- name: Bit Custom Command
40+
uses: vturb/bit-command@v1
3941
with:
40-
ws-dir: '<WORKSPACE_DIR_PATH>'
41-
- name: Bit Verify
42-
uses: bit-tasks/verify@v1
42+
cmd: lint -a
4343
```
4444
4545
# Contributor Guide

action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: 'Bit Verify'
2-
description: 'Verify issues in bit components'
1+
name: 'Bit Command'
2+
description: 'Execute a custom bit command'
33
branding:
44
icon: 'check'
5-
color: 'purple'
5+
color: 'green'
66
inputs:
7+
cmd:
8+
description: "Custom command to execute"
9+
required: true
710
ws-dir:
811
description: "Workspace json file directory path"
912
required: false
10-
skip-build:
11-
description: "Skip running 'bit build'"
12-
required: false
1313
runs:
1414
using: 'node16'
1515
main: 'dist/index.js'

dist/index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3967,11 +3967,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39673967
};
39683968
Object.defineProperty(exports, "__esModule", ({ value: true }));
39693969
const core = __importStar(__nccwpck_require__(186));
3970-
const verify_1 = __importDefault(__nccwpck_require__(903));
3970+
const command_1 = __importDefault(__nccwpck_require__(874));
39713971
try {
39723972
const wsDir = core.getInput("ws-dir") || process.env.WSDIR || "./";
3973-
const skipBuild = core.getInput("skip-build") === "true" ? true : false;
3974-
(0, verify_1.default)(skipBuild, wsDir);
3973+
(0, command_1.default)(core.getInput("cmd"), wsDir);
39753974
}
39763975
catch (error) {
39773976
core.setFailed(error.message);
@@ -3980,7 +3979,7 @@ catch (error) {
39803979

39813980
/***/ }),
39823981

3983-
/***/ 903:
3982+
/***/ 874:
39843983
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
39853984

39863985
"use strict";
@@ -3996,11 +3995,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
39963995
};
39973996
Object.defineProperty(exports, "__esModule", ({ value: true }));
39983997
const exec_1 = __nccwpck_require__(514);
3999-
const run = (skipBuild, wsdir) => __awaiter(void 0, void 0, void 0, function* () {
4000-
yield (0, exec_1.exec)("bit status --strict", [], { cwd: wsdir });
4001-
if (!skipBuild) {
4002-
yield (0, exec_1.exec)("bit build", [], { cwd: wsdir });
4003-
}
3998+
const run = (cmd, wsdir) => __awaiter(void 0, void 0, void 0, function* () {
3999+
yield (0, exec_1.exec)(`bit ${cmd}`, [], { cwd: wsdir });
40044000
});
40054001
exports["default"] = run;
40064002

index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import * as core from "@actions/core";
2-
import run from "./scripts/verify";
2+
import run from "./scripts/command";
33

44
try {
55
const wsDir: string = core.getInput("ws-dir") || process.env.WSDIR || "./";
6-
const skipBuild: boolean =
7-
core.getInput("skip-build") === "true" ? true : false;
8-
run(skipBuild, wsDir);
6+
run(core.getInput("cmd"), wsDir);
97
} catch (error) {
108
core.setFailed((error as Error).message);
119
}

scripts/command.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { exec } from "@actions/exec";
2+
3+
const run = async (cmd: string, wsdir: string) => {
4+
await exec(`bit ${cmd}`, [], { cwd: wsdir });
5+
};
6+
7+
export default run;

scripts/verify.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)