Commit 66a7045
authored
fix: do not revoke token if already expired (actions#147)
Closes actions#140
The pull request at actions#95 introduced changes to avoid revoking expired
tokens by saving the `expiresAt` value in the state. The change,
however, used `core.setOutput` instead of `core.setState` meaning the
value is not saved in the state but rather available in the output.
```javascript
if (!skipTokenRevoke) {
core.saveState("token", authentication.token);
core.setOutput("expiresAt", authentication.expiresAt);
}
```
This means that when we use the value downstream, it evaluates to an
empty string and the following code block is never run:
```javascript
const expiresAt = core.getState("expiresAt");
if (expiresAt && tokenExpiresIn(expiresAt) < 0) {
core.info("Token expired, skipping token revocation");
return;
}
```
This is a tiny PR to correct that typo.1 parent d2eeb38 commit 66a7045
File tree
4 files changed
+11
-20
lines changed- dist
- lib
- tests/snapshots
4 files changed
+11
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39753 | 39753 | | |
39754 | 39754 | | |
39755 | 39755 | | |
39756 | | - | |
| 39756 | + | |
39757 | 39757 | | |
39758 | 39758 | | |
39759 | 39759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | | - | |
98 | | - | |
| 96 | + | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| |||
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
117 | | - | |
118 | | - | |
| 115 | + | |
119 | 116 | | |
120 | 117 | | |
121 | 118 | | |
| |||
134 | 131 | | |
135 | 132 | | |
136 | 133 | | |
137 | | - | |
138 | | - | |
| 134 | + | |
139 | 135 | | |
140 | 136 | | |
141 | 137 | | |
| |||
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
157 | | - | |
158 | | - | |
| 153 | + | |
159 | 154 | | |
160 | 155 | | |
161 | 156 | | |
| |||
175 | 170 | | |
176 | 171 | | |
177 | 172 | | |
178 | | - | |
179 | | - | |
| 173 | + | |
180 | 174 | | |
181 | 175 | | |
182 | 176 | | |
| |||
195 | 189 | | |
196 | 190 | | |
197 | 191 | | |
198 | | - | |
199 | | - | |
| 192 | + | |
200 | 193 | | |
201 | 194 | | |
202 | 195 | | |
| |||
215 | 208 | | |
216 | 209 | | |
217 | 210 | | |
218 | | - | |
219 | | - | |
| 211 | + | |
220 | 212 | | |
221 | 213 | | |
222 | 214 | | |
| |||
235 | 227 | | |
236 | 228 | | |
237 | 229 | | |
238 | | - | |
239 | | - | |
| 230 | + | |
240 | 231 | | |
241 | 232 | | |
242 | 233 | | |
| |||
Binary file not shown.
0 commit comments