Skip to content

Commit e3b769f

Browse files
authored
Escape forwardslash (#15)
* try escapeing * ignore eslint * / debugging * debug * update dist * auto commit dist buil * auto commit dist buil * token * Commit from GitHub Actions (.github/workflows/pull-request.yaml) --------- Co-authored-by: Benbentwo <[email protected]>
1 parent d8d1598 commit e3b769f

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed

.github/workflows/pull-request.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v3
1616
with:
17-
ref: ${{ github.ref }}
18-
fetch-depth: 0
19-
17+
repository: ${{ github.event.pull_request.head.repo.full_name }}
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
20+
2021
- uses: actions/setup-node@v3
2122
with:
2223
node-version: 16
@@ -40,7 +41,10 @@ jobs:
4041

4142
- name: Build
4243
run: yarn build
43-
44+
45+
- name: Add & Commit
46+
uses: EndBug/[email protected]
47+
4448
- name: Test Action Lowercase
4549
id: lowercase
4650
uses: ./ # Uses an action in the root directory

dist/index.js

Lines changed: 22 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/operations/kebabcase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function kebabcase(str: string): string {
22
return str.replace(/([a-z])([A-Z])/g, "$1-$2")
33
.replace(/[\s_/]+/g, '-')
4-
.toLowerCase().replace('/', '-');
4+
.toLowerCase();
55
}

src/run.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as core from "@actions/core";
2-
import {lowercase} from "./operations/lowercase";
3-
import {uppercase} from "./operations/uppercase";
4-
import {kebabcase} from "./operations/kebabcase";
5-
import {dnsSubdomain} from "./operations/dns-subdomain";
2+
import { lowercase } from "./operations/lowercase";
3+
import { uppercase } from "./operations/uppercase";
4+
import { kebabcase } from "./operations/kebabcase";
5+
import { dnsSubdomain } from "./operations/dns-subdomain";
66

77
export async function run() {
88
try {
@@ -23,10 +23,10 @@ export async function run() {
2323
outputString = kebabcase(inputString);
2424
break;
2525
case "dns-subdomain":
26-
outputString = dnsSubdomain(inputString, maxLength)
26+
outputString = dnsSubdomain(inputString, maxLength);
2727
break;
2828
default:
29-
core.setFailed(`Invalid operation: ${operation}`)
29+
core.setFailed(`Invalid operation: ${operation}`);
3030
}
3131

3232
if (maxLength > 0 && outputString.length > maxLength) {

0 commit comments

Comments
 (0)