Skip to content

Commit

Permalink
Deploy Production Code for Commit ac5e641 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Nov 9, 2024
1 parent ac5e641 commit d409b29
Show file tree
Hide file tree
Showing 2,723 changed files with 270,956 additions and 499,526 deletions.
2 changes: 1 addition & 1 deletion lib/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSponsors = exports.generateFile = void 0;
exports.default = run;
const core_1 = require("@actions/core");
const constants_1 = require("./constants");
const template_1 = require("./template");
Expand Down Expand Up @@ -85,4 +86,3 @@ function run(configuration) {
return status;
});
}
exports.default = run;
1 change: 0 additions & 1 deletion lib/template.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'cross-fetch/polyfill';
import { ActionInterface, GitHubResponse, Status } from './constants';
/**
* Fetches sponsors from the GitHub Sponsors API.
Expand Down
25 changes: 16 additions & 9 deletions lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateFile = exports.generateTemplate = exports.getSponsors = void 0;
require("cross-fetch/polyfill");
exports.getSponsors = getSponsors;
exports.generateTemplate = generateTemplate;
exports.generateFile = generateFile;
const fs_1 = require("fs");
const constants_1 = require("./constants");
const mustache_1 = require("mustache");
Expand Down Expand Up @@ -77,16 +78,23 @@ function getSponsors(action) {
}
});
}
exports.getSponsors = getSponsors;
/**
* Generates the sponsorship template.
*/
function generateTemplate(response, action) {
var _a, _b, _c, _d;
let template = ``;
(0, core_1.info)('Generating template… ✨');
const data = action.organization
? response.data.organization
: response.data.viewer;
/**
* Determines if the response is from an organization or a user.
* Performs checks to see if the data is available before we
* reference it as the API results can be somewhat sporadic.
*/
const data = action.organization && ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.organization)
? (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.organization
: ((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.viewer)
? (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.viewer
: null;
const sponsorshipsAsMaintainer = data === null || data === void 0 ? void 0 : data.sponsorshipsAsMaintainer;
if (sponsorshipsAsMaintainer) {
let filteredSponsors = sponsorshipsAsMaintainer.nodes.filter((user) => (user.tier && user.tier.monthlyPriceInCents
Expand Down Expand Up @@ -121,7 +129,7 @@ function generateTemplate(response, action) {
? user.tier.monthlyPriceInCents
: 0) <= action.maximum);
}
(0, core_1.info)(`Found ${filteredSponsors.length} matching sponsors… ${filteredSponsors.length > 0 ? '🎉' : '😢'}`);
(0, core_1.info)(`Found ${filteredSponsors.length} matching ${filteredSponsors.length === 1 ? 'sponsor' : 'sponsors'}${filteredSponsors.length > 0 ? '🎉' : '😢'}`);
/**
* If there are no valid sponsors then we return the provided fallback.
*/
Expand All @@ -147,10 +155,10 @@ function generateTemplate(response, action) {
}
else {
(0, core_1.info)(`No sponsorship data was found… ❌`);
return action.fallback;
}
return template;
}
exports.generateTemplate = generateTemplate;
/**
* Generates the updated file with the attached sponsorship template.
*/
Expand All @@ -173,4 +181,3 @@ function generateFile(response, action) {
}
});
}
exports.generateFile = generateFile;
2 changes: 1 addition & 1 deletion node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/tldts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion node_modules/.bin/uuid

This file was deleted.

151 changes: 151 additions & 0 deletions node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions node_modules/@actions/core/lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@actions/core/lib/command.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions node_modules/@actions/core/lib/core.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d409b29

Please sign in to comment.