@jamesives/github-sponsors-readme-action
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -75,2 +75,61 @@ import {GitHubResponse, PrivacyLevel, Status, Urls} from '../src/constants' | ||
it('should fallback to url if websiteUrl is not provided', () => { | ||
const response: GitHubResponse = { | ||
data: { | ||
viewer: { | ||
sponsorshipsAsMaintainer: { | ||
totalCount: 2, | ||
pageInfo: { | ||
endCursor: 'MQ' | ||
}, | ||
nodes: [ | ||
{ | ||
createdAt: '123', | ||
privacyLevel: PrivacyLevel.PUBLIC, | ||
tier: { | ||
monthlyPriceInCents: 5000 | ||
}, | ||
sponsorEntity: { | ||
name: 'James Ives', | ||
login: 'JamesIves', | ||
url: 'https://github.com/JamesIves', | ||
websiteUrl: null | ||
} | ||
}, | ||
{ | ||
createdAt: '123', | ||
privacyLevel: PrivacyLevel.PUBLIC, | ||
tier: { | ||
monthlyPriceInCents: 5000 | ||
}, | ||
sponsorEntity: { | ||
name: 'Montezuma Ives', | ||
login: 'MontezumaIves', | ||
url: 'https://github.com/MontezumaIves', | ||
websiteUrl: null | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
const action = { | ||
token: '123', | ||
file: 'README.test.md', | ||
template: | ||
'<a href="{{{ websiteUrl }}}"><img src="https://github.com/{{{ login }}}.png" width="60px" alt="" /></a>', | ||
minimum: 0, | ||
maximum: 0, | ||
marker: 'sponsors', | ||
organization: false, | ||
fallback: '' | ||
} | ||
expect(generateTemplate(response, action)).toEqual( | ||
'<a href="https://github.com/JamesIves"><img src="https://github.com/JamesIves.png" width="60px" alt="" /></a><a href="https://github.com/MontezumaIves"><img src="https://github.com/MontezumaIves.png" width="60px" alt="" /></a>' | ||
) | ||
}) | ||
it('should filter out sponsors who are marked as private', () => { | ||
@@ -77,0 +136,0 @@ const response: GitHubResponse = { |
@@ -102,2 +102,3 @@ "use strict"; | ||
filteredSponsors.map(({ sponsorEntity }) => { | ||
sponsorEntity.websiteUrl = sponsorEntity.websiteUrl || sponsorEntity.url; | ||
template = template += (0, mustache_1.render)(action.template, sponsorEntity); | ||
@@ -104,0 +105,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "lib/lib.js", |
@@ -41,3 +41,3 @@ <p align="center"> | ||
<p align="center"> | ||
<!-- real-sponsors --><a href="https://github.com/Chooksta69"><img src="https://github.com/Chooksta69.png" width="50px" alt="Chooksta69" /></a> <a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a> <a href="https://github.com/hadley"><img src="https://github.com/hadley.png" width="50px" alt="hadley" /></a> <a href="https://github.com/kevinchalet"><img src="https://github.com/kevinchalet.png" width="50px" alt="kevinchalet" /></a> <a href="https://github.com/annegentle"><img src="https://github.com/annegentle.png" width="50px" alt="annegentle" /></a> <!-- real-sponsors --> | ||
<!-- real-sponsors --><!-- real-sponsors --> | ||
</p> | ||
@@ -44,0 +44,0 @@ |
@@ -126,2 +126,3 @@ import 'cross-fetch/polyfill' | ||
filteredSponsors.map(({sponsorEntity}) => { | ||
sponsorEntity.websiteUrl = sponsorEntity.websiteUrl || sponsorEntity.url | ||
template = template += render(action.template, sponsorEntity) | ||
@@ -128,0 +129,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
191755
1714