Skip to content

Commit d96fc32

Browse files
authored
Merge pull request #32 from bit-tasks/remove-persist-option
fix: remove persist option
2 parents 436d6a5 + 774dc43 commit d96fc32

5 files changed

Lines changed: 16 additions & 25 deletions

File tree

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
# Bit Tag and Export for CI/CD Pipelines
2+
23
Big Tag and Export to Remote Scope
34

45
# GitHub Actions
56

67
This task executes `bit ci merge` inside the workspace directory.
78

8-
*Important*: `bit-tasks/tag-export@v3` requires Bit version `^1.12.45`, if you need to use a lower version, use `bit-tasks/tag-export@v2`.
9+
_Important_: `bit-tasks/tag-export@v3|v4` requires Bit version `^1.12.45`, if you need to use a lower version, use `bit-tasks/tag-export@v2`.
910

1011
## Inputs
1112

1213
### `ws-dir`
1314

1415
**Optional** The workspace directory path from the root. Default `"Dir specified in Init Task or ./"`.
1516

16-
### `persist`
17-
18-
**Optional** Persist soft tagged components by adding `--persist` flag.
19-
2017
### `build`
2118

2219
**Optional** Build the components before tagging.
@@ -28,6 +25,7 @@ This task executes `bit ci merge` inside the workspace directory.
2825
### `increment`
2926

3027
**Optional** Type of increment for versioning. Available options:
28+
3129
- `major` - Major version increment
3230
- `premajor` - Pre-major version increment
3331
- `minor` - Minor version increment
@@ -61,17 +59,19 @@ The task detects version keywords in the following order:
6159
You can specify version keywords using square brackets in either PR labels or PR title:
6260

6361
- `[major]` - Major version increment
64-
- `[minor]` - Minor version increment
62+
- `[minor]` - Minor version increment
6563
- `[patch]` - Patch version increment (default)
6664
- `[pre-release:<flag>]` - Pre-release version with custom identifier (e.g., `[pre-release:beta]`, `[pre-release:alpha]`)
6765

6866
### Examples
6967

7068
**Pull Request Labels:**
69+
7170
- Add a label named `[major]` to trigger a major version bump
7271
- Add a label named `[pre-release:rc]` to create a release candidate
7372

7473
**Pull Request Title:**
74+
7575
- "Update component with breaking changes [major]"
7676
- "Add new feature [minor]"
7777
- "Fix bug [patch]"
@@ -80,24 +80,25 @@ You can specify version keywords using square brackets in either PR labels or PR
8080
### Fallback Behavior
8181

8282
If no version keywords are detected in the last merged PR, the task will use the input parameters:
83+
8384
- `increment` parameter (e.g., `major`, `minor`, `patch`)
8485
- `prerelease-id` parameter for pre-release versions
8586

8687
**Note:** The task processes the last merged pull request, not the current one. Make sure to add version keywords to the PR that will be merged before this task runs.
8788

8889
## Example usage
8990

90-
**Note:** Use `bit-task/init@v2` as a prior step in your action before running `bit-tasks/tag-export@v2`.
91+
**Note:** Use `bit-task/init@v2` as a prior step in your action before running `bit-tasks/tag-export@v4`.
9192

9293
```yaml
9394
name: Test Bit Tag and Export
9495
on:
9596
pull_request:
96-
branches:
97+
branches:
9798
- main
9899
types: [closed]
99100
permissions:
100-
pull-requests: write # Ensure write permission for pull requests
101+
pull-requests: write # Ensure write permission for pull requests
101102
jobs:
102103
release:
103104
runs-on: ubuntu-latest
@@ -113,11 +114,9 @@ jobs:
113114
- name: Initialize Bit
114115
uses: bit-tasks/init@v1
115116
with:
116-
ws-dir: '<WORKSPACE_DIR_PATH>'
117+
ws-dir: "<WORKSPACE_DIR_PATH>"
117118
- name: Bit Tag and Export
118-
uses: bit-tasks/tag-export@v3
119-
with:
120-
persist: 'false' # Set to 'true' if you use the soft tag flow
119+
uses: bit-tasks/tag-export@v4
121120
```
122121
123122
# Contributor Guide
@@ -132,7 +131,7 @@ Go to the GithHub action task directory and build using NCC compiler. For exampl
132131
npm install
133132
npm run build
134133
git commit -m "Update task"
135-
git tag -a -m "action release" v2 --force
134+
git tag -a -m "action release" v4 --force
136135
git push --follow-tags
137136
```
138137

action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ inputs:
77
ws-dir:
88
description: "Workspace json file directory path"
99
required: false
10-
persist:
11-
description: "Persist soft tagged components"
12-
required: false
1310
build:
1411
description: "Build the components"
1512
required: false

index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import run from "./scripts/tag-export";
44
try {
55
const githubToken = process.env.GITHUB_TOKEN;
66
const wsDir: string = core.getInput("ws-dir") || process.env.WSDIR || "./";
7-
const persist: boolean = core.getInput("persist") === "true" ? true : false;
87
const build: boolean = core.getInput("build") === "true" ? true : false;
98
const increment: string = core.getInput("increment");
109
const prereleaseId: string = core.getInput("prerelease-id");
@@ -15,7 +14,7 @@ try {
1514
throw new Error("GitHub token not found");
1615
}
1716

18-
run(githubToken, wsDir, persist, build, increment, prereleaseId, incrementBy, strict);
17+
run(githubToken, wsDir, build, increment, prereleaseId, incrementBy, strict);
1918
} catch (error) {
2019
core.setFailed((error as Error).message);
2120
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bit-tasks/tag-export",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "",
55
"main": "dist/index.js",
66
"scripts": {

scripts/tag-export.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function getOverridenVersions(labels?: any[]): string[] {
7575
});
7676
}
7777

78-
const run = async (githubToken: string, wsdir: string, persist: boolean, build: boolean, increment: string, prereleaseId: string, incrementBy: number, strict: boolean) => {
78+
const run = async (githubToken: string, wsdir: string, build: boolean, increment: string, prereleaseId: string, incrementBy: number, strict: boolean) => {
7979
const version = await getExecOutput("bit -v", [], { cwd: wsdir });
8080

8181
// If the version is lower than 1.12.45, throw an error recommending to downgrade the action version to v2
@@ -136,10 +136,6 @@ const run = async (githubToken: string, wsdir: string, persist: boolean, build:
136136
}
137137
}
138138

139-
if (persist) {
140-
mergeArgs.push("--persist");
141-
}
142-
143139
// Get overridden versions as an array
144140
const overridenComponentVersions = getOverridenVersions(lastMergedPR?.labels);
145141
core.info("Overriden labels: " + overridenComponentVersions.join(", "));

0 commit comments

Comments
 (0)