Skip to content

Commit

Permalink
feat: changed to gh action signed commits
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilmhdh committed Nov 12, 2021
1 parent f0ff0e5 commit 21c520a
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 26 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: A job to automate contrib in readme
steps:
- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.2
uses: akhilmhdh/contributors-readme-action@v2.3.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Expand All @@ -41,7 +41,7 @@ That's it!
To add it to your to your existing workflow, append this to your current `.yml` workflow script.

```yml
- uses: akhilmhdh/contributors-readme-action@v2.3.2
- uses: akhilmhdh/contributors-readme-action@v2.3.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Expand Down Expand Up @@ -122,7 +122,7 @@ You can add these optional parameters in your action script to modify the appear

```yml
- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.2
uses: akhilmhdh/contributors-readme-action@v2.3.3
with:
image_size: 100
```
Expand All @@ -135,10 +135,12 @@ You can add these optional parameters in your action script to modify the appear
| columns_per_row | 6 | Number of columns in a row | false |
| collaborators | direct | Type of collaborators options: all/direct/outside | false |
| commit_message | contrib-readme-action has updated readme | Commit message of the github action | false |
| committer_username | contrib-readme-bot | Username on commit | false |
| committer_email | contrib-readme-action@noreply.com | Email id of committer | false |
| committer_username | "" | Username on commit | false |
| committer_email | "" | Email id of committer | false |
| pr_title_on_protected | contributors readme action update | Title of the PR that will be created if the branch is protected | false |

> committer_username and committer_email both must be provided to use as a replacement to GH action committer

> The action will update Readme as PR when the branch is protected, else it will directly commit it.

### Outputs
Expand Down
2 changes: 0 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ inputs:
required: false
committer_username:
description: "Username on commit"
default: "contrib-readme-bot"
required: false
committer_email:
description: "email id of committer"
default: "contrib-readme-action@noreply.com"
required: false
pr_title_on_protected:
description: "Title of the PR that will be created if the branch is protected"
Expand Down
11 changes: 3 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8947,6 +8947,7 @@ async function run() {
}

const base64String = Buffer.from(content, 'utf8').toString('base64');
const committer = email && name ? { email, name } : undefined;

if (prevContent !== content) {
if (isProtected) {
Expand All @@ -8968,10 +8969,7 @@ async function run() {
path,
sha: readme.data.sha,
branch: branchNameForPR,
committer: {
name,
email
}
committer
});

const prDetails = await src_octokit.rest.pulls.create({
Expand All @@ -8991,10 +8989,7 @@ async function run() {
branch,
content: base64String,
sha: readme.data.sha,
committer: {
name,
email
}
committer
});
}
console.log('Updated contribution section of readme');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
{
"name": "contribution-automation-action",
"version": "2.3.2",
"version": "2.3.3",
"description": "A github action to automate contributors section of a readme",
"main": "index.js",
"scripts": {
Expand Down
11 changes: 3 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ async function run() {
}

const base64String = Buffer.from(content, 'utf8').toString('base64');
const committer = email && name ? { email, name } : undefined;

if (prevContent !== content) {
if (isProtected) {
Expand All @@ -157,10 +158,7 @@ async function run() {
path,
sha: readme.data.sha,
branch: branchNameForPR,
committer: {
name,
email
}
committer
});

const prDetails = await octokit.rest.pulls.create({
Expand All @@ -180,10 +178,7 @@ async function run() {
branch,
content: base64String,
sha: readme.data.sha,
committer: {
name,
email
}
committer
});
}
console.log('Updated contribution section of readme');
Expand Down

0 comments on commit 21c520a

Please sign in to comment.