@lvnt/release-radar 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/updater.js +3 -1
- package/dist/updater.test.js +10 -1
- package/package.json +1 -1
package/dist/updater.js
CHANGED
|
@@ -2,7 +2,9 @@ import { createHmac, timingSafeEqual } from 'crypto';
|
|
|
2
2
|
import { spawn } from 'child_process';
|
|
3
3
|
import { createServer } from 'http';
|
|
4
4
|
export function parseReleaseEvent(payload) {
|
|
5
|
-
|
|
5
|
+
// GitHub sends 'published' for new releases and 'released' for made-available releases
|
|
6
|
+
const validActions = ['published', 'released'];
|
|
7
|
+
if (!validActions.includes(payload.action) || !payload.release?.tag_name) {
|
|
6
8
|
return null;
|
|
7
9
|
}
|
|
8
10
|
const tag = payload.release.tag_name;
|
package/dist/updater.test.js
CHANGED
|
@@ -29,7 +29,16 @@ describe('parseReleaseEvent', () => {
|
|
|
29
29
|
};
|
|
30
30
|
expect(parseReleaseEvent(payload)).toBe('1.2.0');
|
|
31
31
|
});
|
|
32
|
-
it('returns
|
|
32
|
+
it('returns version for release.released event', () => {
|
|
33
|
+
const payload = {
|
|
34
|
+
action: 'released',
|
|
35
|
+
release: {
|
|
36
|
+
tag_name: 'v1.2.0'
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
expect(parseReleaseEvent(payload)).toBe('1.2.0');
|
|
40
|
+
});
|
|
41
|
+
it('returns null for other actions', () => {
|
|
33
42
|
const payload = {
|
|
34
43
|
action: 'created',
|
|
35
44
|
release: {
|