Skip to content

Commit

Permalink
clean channel for charmcraft publish from disallowed signs (#91)
Browse files Browse the repository at this point in the history
* clean channel for charmcraft publish from disallowed signs

Co-authored-by: Simon Aronsson <[email protected]>
  • Loading branch information
beliaev-maksim and simskij authored Mar 16, 2023
1 parent f87f888 commit 91ef33d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/charmcraft/charmcraft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,14 @@ class Charmcraft {
const globber = await glob.create('./*.charm');
const paths = await globber.glob();

// filter all characters which are not letters, numbers or hyphens
const allowedChannel = channel.replace(/[^a-zA-Z0-9\-/]/gi, '');
const args = [
'upload',
'--format',
'json',
'--release',
channel,
allowedChannel,
paths[0],
...flags,
];
Expand Down

0 comments on commit 91ef33d

Please sign in to comment.