Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jamesives/github-sponsors-readme-action

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jamesives/github-sponsors-readme-action - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

59

__tests__/template.test.ts

@@ -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 = {

1

lib/template.js

@@ -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 @@ });

2

package.json

@@ -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>&nbsp;&nbsp;<a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a>&nbsp;&nbsp;<a href="https://github.com/hadley"><img src="https://github.com/hadley.png" width="50px" alt="hadley" /></a>&nbsp;&nbsp;<a href="https://github.com/kevinchalet"><img src="https://github.com/kevinchalet.png" width="50px" alt="kevinchalet" /></a>&nbsp;&nbsp;<a href="https://github.com/annegentle"><img src="https://github.com/annegentle.png" width="50px" alt="annegentle" /></a>&nbsp;&nbsp;<!-- 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 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc