-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9117 from ohcnetwork/staging
November Third Week Release; v24.47.0
- Loading branch information
Showing
139 changed files
with
3,184 additions
and
6,167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Notify Core Team on Non-Core Questions | ||
on: | ||
issue_comment: | ||
types: [created] | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
jobs: | ||
notify_core_team: | ||
runs-on: ubuntu-latest | ||
env: | ||
ALLOWED_USERNAMES: ${{ vars.ALLOWED_USERNAMES }} | ||
QUESTION_KEYWORDS: ${{ vars.QUESTION_KEYWORDS }} | ||
QUESTION_LABELS: ${{ vars.QUESTION_LABELS }} | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
steps: | ||
- name: Check and Notify | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
console.log('Script started'); | ||
const isOrgMember = (commenter, allowedUsers) => { | ||
return allowedUsers.split(',').map(u => u.trim()).includes(commenter); | ||
}; | ||
const containsQuestionKeywords = (text, keywords) => { | ||
return keywords.split(',').map(k => k.trim()).some(keyword => | ||
text.toLowerCase().includes(keyword.toLowerCase()) | ||
); | ||
}; | ||
const addLabelsToIssue = async (github, context, labelsString) => { | ||
const labels = labelsString.split(',').map(label => label.trim()).filter(label => label); | ||
if (labels.length > 0) { | ||
console.log('Adding labels:', labels); | ||
await github.rest.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.issue.number, | ||
labels: labels | ||
}); | ||
} | ||
}; | ||
const sendSlackNotification = async (webhook, payload) => { | ||
const response = await fetch(webhook, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify(payload) | ||
}); | ||
if (!response.ok) { | ||
throw new Error(`HTTP error! status: ${response.status}`); | ||
} | ||
}; | ||
const commenter = context.payload.comment.user.login; | ||
console.log('Commenter:', commenter); | ||
if (!isOrgMember(commenter, process.env.ALLOWED_USERNAMES)) { | ||
const commentBody = context.payload.comment.body; | ||
const sanitizedComment = commentBody | ||
?.replace(/[^\w\s?]/gi, '') | ||
.toLowerCase(); | ||
console.log('Comment body:', sanitizedComment); | ||
if (containsQuestionKeywords(sanitizedComment, process.env.QUESTION_KEYWORDS)) { | ||
try { | ||
console.log('Adding labels to the issue'); | ||
await addLabelsToIssue(github, context, process.env.QUESTION_LABELS); | ||
console.log('Labels added successfully'); | ||
const issueUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/issues/${context.payload.issue.number}`; | ||
const issueTitle = context.payload.issue.title; | ||
const issueNumber = context.payload.issue.number; | ||
console.log('Issue URL:', issueUrl); | ||
console.log('Issue Title:', issueTitle); | ||
console.log('Issue Number:', issueNumber); | ||
const payload = { | ||
link: issueUrl, | ||
Question: commentBody, | ||
"issue-number": issueNumber, | ||
title: issueTitle, | ||
user: commenter | ||
}; | ||
await sendSlackNotification(process.env.SLACK_WEBHOOK, payload); | ||
console.log('Slack notification sent successfully'); | ||
} catch (error) { | ||
console.error('Workflow failed:', error.message); | ||
core.setFailed(`Workflow failed: ${error.message}`); | ||
} | ||
} | ||
} | ||
console.log('Script ended'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,4 @@ cypress/fixtures/token.json | |
# Care Apps | ||
/apps/* | ||
src/pluginMap.ts | ||
/apps_backup/* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v20 | ||
v22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.