Commit e12e9e4
committed
fix: safely replace description placeholder in janitor run
Before this commit a (single-)quote or the pipe symbol in the description would
make the janitor fail to replace the description placeholder as those made the
sed statement malformed.
A first fix is to store the value of the description in a variable and
pass that to the sed statement. This eliminates the problems of quotes
and variable expansion due to $ signs. The variable had to be passed
as a real variable instead of using githubs variable replacement
as with that the shell would still see the quotes and parse them.
The second thing to fix is to escape any occurences of the pipe symbol
in the description as that is what the sed command uses as its
delimiter. The escaping has to be done by adding a literal \ to
the description so during the sed command the | will stay in place.
While doing this it became clear that also the \ has to be escaped
as it would otherwise vanish after the sed run. Thus this is done
prior to escaping the pipe symbol in order to not also mess with
the introduced \ in that command.
To verify it is working the test step gained a new variable that
is injected if the it is no new repo. With this at least it is
checked that the description can contain the special characters.
One thing to note though is that setting the test variable and
extracting the actual description need to look alike so we can
be sure the actual retrieval will not fail.1 parent 1015c6b commit e12e9e4
1 file changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
63 | 78 | | |
64 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
65 | 86 | | |
66 | 87 | | |
67 | 88 | | |
68 | 89 | | |
69 | 90 | | |
70 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
71 | 97 | | |
72 | 98 | | |
73 | 99 | | |
| |||
81 | 107 | | |
82 | 108 | | |
83 | 109 | | |
84 | | - | |
| 110 | + | |
| 111 | + | |
85 | 112 | | |
86 | 113 | | |
87 | 114 | | |
| |||
0 commit comments