Skip to content

Commit 49d0626

Browse files
authored
Merge pull request #13 from dscho/html-to-md-v0.8.0
Bump `html-to-md` to v0.8.0
2 parents 394ee85 + 203e277 commit 49d0626

File tree

5 files changed

+61
-12
lines changed

5 files changed

+61
-12
lines changed

__tests__/index.test.js

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const https = require('https')
33

44
jest.mock('@actions/core')
55
jest.mock('@actions/github')
6-
jest.mock('html-to-md')
76

87
const core = require('@actions/core')
98
const { getOctokit, context } = require('@actions/github')
@@ -69,6 +68,56 @@ test('handles feed entries without titles', async () => {
6968
owner: 'owner',
7069
repo: 'repo',
7170
title: new Date(date).toUTCString(),
72-
body: '\n'
71+
body: 'TBD\n'
72+
})
73+
})
74+
75+
test('html to markdown conversion', async () => {
76+
const date = new Date().toISOString()
77+
mockHTTPSGet.__RETURN__ = `<?xml version="1.0" encoding="UTF-8"?>
78+
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
79+
<id>tag:github.com,2008:/git-for-windows/rss-to-issues/commits/main</id>
80+
<link type="text/html" rel="alternate" href="https://github.com/git-for-windows/rss-to-issues/commits/main"/>
81+
<link type="application/atom+xml" rel="self" href="https://github.com/git-for-windows/rss-to-issues/commits/main.atom"/>
82+
<title>Recent Commits to rss-to-issues:main</title>
83+
<updated>${date}</updated>
84+
<entry>
85+
<id>tag:github.com,2008:Grit::Commit/394ee852b18c5e3bca536b585cbb95d32ce77057</id>
86+
<link type="text/html" rel="alternate" href="https://github.com/git-for-windows/rss-to-issues/commit/394ee852b18c5e3bca536b585cbb95d32ce77057"/>
87+
<title>
88+
ci(release-tags): use newer versions of Actions
89+
</title>
90+
<updated>${date}</updated>
91+
<media:thumbnail height="30" width="30" url="https://avatars.githubusercontent.com/u/127790?s=30&amp;v=4"/>
92+
<author>
93+
<name>dscho</name>
94+
<uri>https://github.com/dscho</uri>
95+
</author>
96+
<content type="html">
97+
&lt;pre style=&#39;white-space:pre-wrap;width:81ex&#39;&gt;ci(release-tags): use newer versions of Actions
98+
99+
This avoids warnings about node.js/set-output deprecations.
100+
101+
Signed-off-by: Johannes Schindelin &amp;lt;johannes.schindelin@gmx.de&amp;gt;&lt;/pre&gt;
102+
</content>
103+
</entry>
104+
</feed>
105+
`
106+
octokit.issues.listForRepo.mockReturnValueOnce({ data: [] })
107+
await run()
108+
109+
expect(octokit.issues.create).toBeCalledWith({
110+
owner: 'owner',
111+
repo: 'repo',
112+
title: 'ci(release-tags): use newer versions of Actions',
113+
body: `\`\`\`
114+
ci(release-tags): use newer versions of Actions
115+
116+
This avoids warnings about node.js/set-output deprecations.
117+
118+
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
119+
\`\`\`
120+
121+
https://github.com/git-for-windows/rss-to-issues/commit/394ee852b18c5e3bca536b585cbb95d32ce77057`
73122
})
74123
})

dist/index.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"dependencies": {
2929
"@actions/core": "^1.10.0",
3030
"@actions/github": "^4.0.0",
31-
"html-to-md": "^0.5.3",
31+
"html-to-md": "^0.8.0",
3232
"rss-parser": "^3.12.0"
3333
},
3434
"devDependencies": {

0 commit comments

Comments
 (0)