Skip to content

Commit

Permalink
Merge pull request #276 from anuraghazra/master
Browse files Browse the repository at this point in the history
[pull] master from anuraghazra:master
  • Loading branch information
pull[bot] authored Oct 30, 2023
2 parents 130cb34 + 2b90336 commit 527c412
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
reviewers:
- "qwerty541"

# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
reviewers:
- "qwerty541"
2 changes: 1 addition & 1 deletion .github/workflows/empty-issues-closer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Run empty issues closer action
uses: rickstaa/empty-issues-closer-action@af151e679df0e3b59cda0e10c43010556d6c5bff # v1.1.35
uses: rickstaa/empty-issues-closer-action@2ee9f86f16acb1d888a480f2080407d84248f475 # v1.1.39
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ossf-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/top-issues-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run top issues action
uses: rickstaa/top-issues-action@36df2af30c15ddf48558931420138890ed1b1708 # v1.3.61
uses: rickstaa/top-issues-action@f72e408e2ca430a9d79620f27183d7fd85c7494a # v1.3.64
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async (req, res) => {

if (blacklist.includes(username)) {
return res.send(
renderError("Something went wrong", "", {
renderError("Something went wrong", "This username is blacklisted", {
title_color,
text_color,
bg_color,
Expand Down
2 changes: 1 addition & 1 deletion api/pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default async (req, res) => {

if (blacklist.includes(username)) {
return res.send(
renderError("Something went wrong", "", {
renderError("Something went wrong", "This username is blacklisted", {
title_color,
text_color,
bg_color,
Expand Down
2 changes: 1 addition & 1 deletion api/top-langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default async (req, res) => {

if (blacklist.includes(username)) {
return res.send(
renderError("Something went wrong", "", {
renderError("Something went wrong", "This username is blacklisted", {
title_color,
text_color,
bg_color,
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"prettier": "^3.0.3"
},
"dependencies": {
"axios": "^1.5.1",
"axios": "^1.6.0",
"dotenv": "^16.3.1",
"emoji-name-map": "^1.2.8",
"github-username-regex": "^1.0.0",
Expand Down
19 changes: 18 additions & 1 deletion tests/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,21 @@ describe("Test /api/", () => {
);
});

it("should render error card in same theme as requested card", async () => {
const { req, res } = faker({ theme: "merko" }, error);

await api(req, res);

expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(
renderError(
error.errors[0].message,
"Make sure the provided username is not an organization",
{ theme: "merko" },
),
);
});

it("should get the query options", async () => {
const { req, res } = faker(
{
Expand Down Expand Up @@ -291,7 +306,9 @@ describe("Test /api/", () => {
await api(req, res);

expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(renderError("Something went wrong"));
expect(res.send).toBeCalledWith(
renderError("Something went wrong", "This username is blacklisted"),
);
});

it("should render error card when wrong locale is provided", async () => {
Expand Down
4 changes: 3 additions & 1 deletion tests/pin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ describe("Test /api/pin", () => {
await pin(req, res);

expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(renderError("Something went wrong"));
expect(res.send).toBeCalledWith(
renderError("Something went wrong", "This username is blacklisted"),
);
});

it("should render error card if wrong locale provided", async () => {
Expand Down
4 changes: 3 additions & 1 deletion tests/top-langs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ describe("Test /api/top-langs", () => {
await topLangs(req, res);

expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(renderError("Something went wrong"));
expect(res.send).toBeCalledWith(
renderError("Something went wrong", "This username is blacklisted"),
);
});

it("should render error card if wrong locale provided", async () => {
Expand Down

1 comment on commit 527c412

@vercel
Copy link

@vercel vercel bot commented on 527c412 Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.