Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: contributor-assistant/github-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.3.1
Choose a base ref
...
head repository: contributor-assistant/github-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.3.2
Choose a head ref
  • 3 commits
  • 5 files changed
  • 3 contributors

Commits on Mar 9, 2024

  1. fix: create empty commit for custom pr sign comment as well

    tada5hi committed Mar 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    tada5hi Peter
    Copy the full SHA
    f4faf18 View commit details

Commits on Mar 20, 2024

  1. Merge pull request #147 from tada5hi/pr-sign-commit

    fix: create empty commit for custom pr sign comment as well
    ibakshay authored Mar 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    87da410 View commit details
  2. docs(contributor): contrib-readme-action has updated readme

    github-actions[bot] authored Mar 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dbc1c64 View commit details
Showing with 37 additions and 14 deletions.
  1. +1 −0 .gitignore
  2. +25 −10 README.md
  3. +3 −2 src/addEmptyCommit.ts
  4. +3 −2 src/pullrequest/pullRequestCommentContent.ts
  5. +5 −0 src/shared/pr-sign-comment.ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@ __tests__/runner/*
.vscode
node_modules
lib
.idea
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -172,21 +172,28 @@ This PAT should have repo scope and is only required if you have configured to s
<sub><b>Filip Moroz</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mmv08">
<img src="https://avatars.githubusercontent.com/u/16622558?v=4" width="100;" alt="mmv08"/>
<br />
<sub><b>Mikhail</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/manifestinteractive">
<img src="https://avatars.githubusercontent.com/u/508411?v=4" width="100;" alt="manifestinteractive"/>
<br />
<sub><b>Peter Schmalfeldt</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/mattrosno">
<img src="https://avatars.githubusercontent.com/u/1691245?v=4" width="100;" alt="mattrosno"/>
<br />
<sub><b>Matt Rosno</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/Or-Geva">
<img src="https://avatars.githubusercontent.com/u/9606235?v=4" width="100;" alt="Or-Geva"/>
@@ -221,15 +228,15 @@ This PAT should have repo scope and is only required if you have configured to s
<br />
<sub><b>Charlie Fish</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/darrellwarde">
<img src="https://avatars.githubusercontent.com/u/8117355?v=4" width="100;" alt="darrellwarde"/>
<br />
<sub><b>Darrell Warde</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/nwalters512">
<img src="https://avatars.githubusercontent.com/u/1476544?v=4" width="100;" alt="nwalters512"/>
@@ -264,15 +271,15 @@ This PAT should have repo scope and is only required if you have configured to s
<br />
<sub><b>Tate Berenbaum</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Krinkle">
<img src="https://avatars.githubusercontent.com/u/156867?v=4" width="100;" alt="Krinkle"/>
<br />
<sub><b>Timo Tijhof</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/AndrewGable">
<img src="https://avatars.githubusercontent.com/u/2838819?v=4" width="100;" alt="AndrewGable"/>
@@ -287,6 +294,13 @@ This PAT should have repo scope and is only required if you have configured to s
<sub><b>Knanao</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/tada5hi">
<img src="https://avatars.githubusercontent.com/u/13162758?v=4" width="100;" alt="tada5hi"/>
<br />
<sub><b>Peter</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/wh201906">
<img src="https://avatars.githubusercontent.com/u/62299611?v=4" width="100;" alt="wh201906"/>
@@ -300,7 +314,8 @@ This PAT should have repo scope and is only required if you have configured to s
<br />
<sub><b>Woyaoshunlibiye </b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/yahavi">
<img src="https://avatars.githubusercontent.com/u/11367982?v=4" width="100;" alt="yahavi"/>
5 changes: 3 additions & 2 deletions src/addEmptyCommit.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ import { context } from '@actions/github'

import * as core from '@actions/core'
import * as input from './shared/getInputs'
import { getPrSignComment } from './shared/pr-sign-comment'


export async function addEmptyCommit() {
@@ -11,8 +12,8 @@ export async function addEmptyCommit() {

if (context.payload.comment) {

//Do empty commit only when the contributor signs the CLA with the PR comment
if (context.payload.comment.body === 'I have read the CLA Document and I hereby sign the CLA') {
//Do empty commit only when the contributor signs the CLA with the PR comment
if (context.payload.comment.body.toLowerCase().trim() === getPrSignComment().toLowerCase().trim()) {
try {
const message = input.getSignedCommitMessage() ?
input.getSignedCommitMessage().replace('$contributorName', contributorName) :
5 changes: 3 additions & 2 deletions src/pullrequest/pullRequestCommentContent.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import {
CommitterMap
} from '../interfaces'
import * as input from '../shared/getInputs'
import { getPrSignComment } from '../shared/pr-sign-comment'

export function commentContent(signed: boolean, committerMap: CommitterMap): string {
// using a `string` true or false purposely as github action input cannot have a boolean value
@@ -72,7 +73,7 @@ function cla(signed: boolean, committerMap: CommitterMap): string {
let lineOne = (input.getCustomNotSignedPrComment() || `<br/>Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that $you sign our [Contributor License Agreement](${input.getPathToDocument()}) before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.<br/>`).replace('$you', you)
let text = `**CLA Assistant Lite bot:** ${lineOne}
- - -
${input.getCustomPrSignComment() || "I have read the CLA Document and I hereby sign the CLA"}
${getPrSignComment()}
- - -
`

@@ -94,4 +95,4 @@ function cla(signed: boolean, committerMap: CommitterMap): string {

text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request</sub>'
return text
}
}
5 changes: 5 additions & 0 deletions src/shared/pr-sign-comment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as input from './getInputs'

export function getPrSignComment() {
return input.getCustomPrSignComment() || "I have read the CLA Document and I hereby sign the CLA"
}