Skip to content

Commit 5a12bfc

Browse files
committed
fix: update worklow
1 parent c65bd5c commit 5a12bfc

2 files changed

Lines changed: 45 additions & 5 deletions

File tree

.github/workflows/automated.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
- name: Setup Node.js
27-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2828
with:
29-
node-version: 14
29+
node-version: 22 # Required for the latest semantic-release plugins
3030
- name: Semantic Release
31-
uses: cycjimmy/semantic-release-action@v3
31+
uses: cycjimmy/semantic-release-action@v4 # Update to v4 for better Node 20+ support
3232
id: semantic
3333
with:
3434
extra_plugins: |
3535
@semantic-release/changelog
3636
@semantic-release/git
3737
@semantic-release/github
3838
env:
39-
GITHUB_TOKEN: "${{ secrets.GITHUB }}"
39+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # Use the built-in token if possible
4040
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
4141
outputs:
4242
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"

src/index.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,46 @@
6767
return depth > 0 ? "../".repeat(depth) : "./";
6868
}
6969

70+
// function getRelativePath(path) {
71+
// const isBrowser = typeof window !== 'undefined';
72+
73+
// // If no path provided, use window.location.pathname
74+
// if (!path && isBrowser) {
75+
// path = window.location.pathname;
76+
77+
// // FIX: Only remove the end segment if it looks like a file (has an extension like .html)
78+
// // This prevents stripping valid routes like /dashboard
79+
// if (/\.[^/]+$/.test(path)) {
80+
// path = path.replace(/\/[^\/]*$/, "");
81+
// }
82+
// }
83+
84+
// // For localhost/127.0.0.1, remove everything up to and including the first '/src'
85+
// if (
86+
// isBrowser &&
87+
// (window.location.hostname === "localhost" ||
88+
// window.location.hostname === "127.0.0.1")
89+
// ) {
90+
// const srcIndex = path.indexOf("/src");
91+
// if (srcIndex !== -1) {
92+
// // If path is "/BeautySalon/src", this returns ""
93+
// path = path.slice(srcIndex + 4);
94+
// }
95+
// }
96+
97+
// // Handle the empty string case here:
98+
// // "" does not end with "/", so it adds one -> "/"
99+
// if (!path || !path.endsWith("/")) {
100+
// path = (path || "") + "/";
101+
// }
102+
103+
// // "/" splits to ['', ''], filter removes them -> length is 0
104+
// let depth = path.split("/").filter(Boolean).length;
105+
106+
// // 0 depth returns "./"
107+
// return depth > 0 ? "../".repeat(depth) : "./";
108+
// }
109+
70110
/**
71111
* Generates an ObjectId
72112
*/

0 commit comments

Comments
 (0)