Skip to content

Commit

Permalink
Update contribution-accepted.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
andreancardona authored Oct 20, 2023
1 parent 7262bb6 commit b3ee677
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/contribution-accepted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,21 @@ jobs:
const eventsArray = events.data.map((label) => label)
console.log('EVENTS ARRAY', eventsArray)
const labelArray = response.data.map((label) => label.name)
const commentsArray = comments.data.map(comment => comment.body)
const commentText = "The Carbon team has accepted this proposal! Our team doesn't have the capacity to work on this now, so we are requesting community contributors. Please see the labels for roles that are needed. If you are willing to help out, comment below and we will get in touch!"
const secondToLastEventTimestamp = new Date(eventsArray[eventsArray.length - 2].created_at)
const lastEventTimestamp = new Date(eventsArray[eventsArray.length - 1].created_at)
const differenceInSeconds = Math.abs((lastEventTimestamp - secondToLastEventTimestamp)/1000)
console.log('seconds',differenceInSeconds)
if (labelArray.includes('proposal: accepted') && labelArray.includes('needs: community contribution') && !commentsArray.includes(commentText) && (differenceInSeconds > 2)) {
github.rest.issues.createComment({
issue_number: context.issue.number,
Expand Down

0 comments on commit b3ee677

Please sign in to comment.