Skip to content

Commit

Permalink
fix: added html string escape to name
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilmhdh committed Jul 19, 2022
1 parent a0a18d5 commit 34f6bc1
Show file tree
Hide file tree
Showing 6 changed files with 7,905 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
name: A job to automate contrib in readme
steps:
- name: Contribute List
uses: akhilmhdh/[email protected].4
uses: akhilmhdh/[email protected].5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Expand All @@ -44,7 +44,7 @@ That's it!
To add it to your to your existing workflow, append this to your current `.yml` workflow script.

```yml
- uses: akhilmhdh/[email protected].4
- uses: akhilmhdh/[email protected].5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Expand Down Expand Up @@ -125,7 +125,7 @@ You can add these optional parameters in your action script to modify the appear

```yml
- name: Contribute List
uses: akhilmhdh/[email protected].4
uses: akhilmhdh/[email protected].5
with:
image_size: 100
```
Expand Down
14 changes: 12 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8583,13 +8583,23 @@ const capitalCaseUtil = str => {
return uniqueArray;
});

;// CONCATENATED MODULE: ./src/utils/htmlEncoding.js
const htmlEncoding = string => {
return String(string)
.replace(/&/g, '&')
.replace(/>/g, '>')
.replace(/</g, '&lt;')
.replace(/"/g, '&quot;');
};

;// CONCATENATED MODULE: ./src/utils/templateBuilder.js







const getTemplate = (userID, imageSize, name, avatarUrl) => {
return `
<td align="center">
Expand All @@ -8616,15 +8626,15 @@ const getUserInfo = async (login, avatarUrl, prevContributors, useUserName) => {
const {
data: { name, avatar_url }
} = await src_octokit.rest.users.getByUsername({ username: login });
return { name: useUserName ? login : name, url: avatar_url };
return { name: useUserName ? login : htmlEncoding(name), url: avatar_url };
} catch (error) {
console.log(`Oops...given github id ${login} is invalid :(`);
return { name: login, url: '' };
}
}

return {
name: useUserName ? login : prevContributors[login].name,
name: useUserName ? login : htmlEncoding(prevContributors[login].name),
url: avatarUrl || prevContributors[login].url
};
};
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 34f6bc1

Please sign in to comment.