Skip to content

Commit 8dcc36b

Browse files
committed
fix: documentation build workflow
Signed-off-by: sarthakjdev <jsarthak448@gmail.com>
1 parent 943019f commit 8dcc36b

6 files changed

Lines changed: 35 additions & 31 deletions

File tree

.github/workflows/documentation-prod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Extract package and semantic version from release tag
6161
if: ${{ github.ref_type == 'tag' }}
6262
id: extract-tag
63-
uses: ./format-tag
63+
uses: ./format-tag/action.yaml
6464
with:
6565
tag: ${{ github.ref_name }}
6666

.github/workflows/formatTag/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ outputs:
1313
description: 'The semver string that was extracted from this tag'
1414
runs:
1515
using: node20
16-
main: ../../dist/formatTag/index.js
16+
main: ./index.js
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export function formatTag(tag) {
2+
const parsed = /(?:^@.*\/(?<package>.*)@v?)?(?<semver>\d+.\d+.\d+)-?.*/.exec(
3+
tag
4+
);
5+
const parsedPackage = /(?<package>.*)@v?-?.*/.exec(tag);
6+
7+
if (parsed?.groups) {
8+
const isSubPackage = typeof parsed.groups.package === "string";
9+
const pkg = isSubPackage
10+
? parsed.groups.package
11+
: parsedPackage?.groups?.package ?? "wapi.js";
12+
const semver = parsed.groups.semver;
13+
14+
return {
15+
isSubpackage: isSubPackage,
16+
package: pkg,
17+
semver,
18+
};
19+
}
20+
21+
return null;
22+
}

.github/workflows/formatTag/formatTag.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { getInput, setOutput } from "@actions/core";
2+
import { formatTag } from "./formatTag.js";
3+
4+
const tag = getInput("tag", { required: true });
5+
const parsed = formatTag(tag);
6+
7+
if (parsed) {
8+
setOutput("subpackage", parsed.isSubpackage);
9+
setOutput("package", parsed.package);
10+
setOutput("semver", parsed.semver);
11+
}

.github/workflows/formatTag/index.ts

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

0 commit comments

Comments
 (0)