Skip to content

Commit b076327

Browse files
committed
Resolved issue by ensuring user provided suitable tag name
1 parent 16695dc commit b076327

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

dist/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ class Connection {
163163
}
164164

165165
protected async createTag() {
166+
console.log(`Creating tag '${this.tag}'`)
167+
166168
let tagger = new Tagger();
167169
let tagObject = await this.createLightweightTag(tagger);
168170

169-
console.log(`Creating tag '${this.tag}'`)
170-
171171
await this.github.rest.git.createRef(
172172
{
173173
...context.repo,
@@ -397,6 +397,9 @@ class Connection {
397397
if (this.tag === '') {
398398
this.tag = this.release;
399399
}
400+
if (/[\\?~^:*\[@\s]|^\/.*$|\/$|\/\/|\.\.|\.$/.test(this.tag)) {
401+
throw new Error("Unsuitable tag name");
402+
}
400403
core.setOutput('release', this.release);
401404
core.setOutput('tag', this.tag);
402405
}

0 commit comments

Comments
 (0)