Add files via upload
This commit is contained in:
parent
fb3a0a386a
commit
dd6fa7245e
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@ -0,0 +1 @@
|
||||
* @ohcnetwork/care-fe-code-reviewers
|
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ""
|
||||
labels: ""
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ""
|
||||
labels: ""
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
24
.github/dependabot.yml
vendored
24
.github/dependabot.yml
vendored
@ -1 +1,25 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
open-pull-requests-limit: 0
|
||||
allow:
|
||||
- dependency-name: "*"
|
||||
dependency-type: "production"
|
||||
assignees:
|
||||
- "tomahawk_pilot"
|
||||
labels:
|
||||
- "dependencies"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
open-pull-requests-limit: 0
|
||||
assignees:
|
||||
- "tomahawk_pilot"
|
||||
labels:
|
||||
- "ci"
|
||||
- "dependencies"
|
||||
|
17
.github/pull_request_template.md
vendored
Normal file
17
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
## Proposed Changes
|
||||
|
||||
- Fixes #issue_number
|
||||
- Change 1
|
||||
- Change 2
|
||||
- More?
|
||||
|
||||
@ohcnetwork/care-fe-code-reviewers
|
||||
|
||||
## Merge Checklist
|
||||
|
||||
- [ ] Add specs that demonstrate bug / test a new feature.
|
||||
- [ ] Update [product documentation](https://docs.ohc.network).
|
||||
- [ ] Ensure that UI text is kept in I18n files.
|
||||
- [ ] Prep screenshot or demo video for changelog entry, and attach it to issue.
|
||||
- [ ] Request for Peer Reviews
|
||||
- [ ] Completion of QA
|
1
.github/runner-files/jwks.b64.txt
vendored
Normal file
1
.github/runner-files/jwks.b64.txt
vendored
Normal file
@ -0,0 +1 @@
|
||||
eyJrZXlzIjogW3sibiI6ICJ4X21fNGNKQ3NHTHN4WkFIa2VCbFZQa2ZqNFNSckdHN3UySERFM3VLX3dFNERhTWhHQ2lxTXFsaTFDM2pxSE5JTVhuWV9ab1M5R3pHbnJpdGg1UUZGVDlL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ZmYXpRX2siLCAiYWxnIjogIlJTMjU2In1dfQ==
|
25
.github/workflows/codeql-analysis.yml
vendored
Normal file
25
.github/workflows/codeql-analysis.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
name: "Code scanning - action"
|
||||
on:
|
||||
push:
|
||||
branches: [develop, master]
|
||||
pull_request:
|
||||
branches: [develop]
|
||||
schedule:
|
||||
- cron: "0 22 * * 0"
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'ohcnetwork/care_fe'
|
||||
permissions:
|
||||
security-events: write
|
||||
actions: read
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: javascript
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
91
.github/workflows/cypress.yaml
vendored
Normal file
91
.github/workflows/cypress.yaml
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
name: Cypress Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- staging
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
cypress-run:
|
||||
permissions: write-all
|
||||
if: github.repository == 'ohcnetwork/care_fe'
|
||||
runs-on: ubuntu-24.04-arm
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
containers: [1]
|
||||
env:
|
||||
REACT_CARE_API_URL: https://careapi.ohc.network
|
||||
|
||||
steps:
|
||||
- name: Checkout 📥
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Determine PR Origin
|
||||
id: pr_origin
|
||||
run: echo "::set-output name=is_forked::$( echo ${{ github.event.pull_request.head.repo.fork }})"
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22.11.0"
|
||||
|
||||
- name: Install dependencies 📦
|
||||
run: npm ci
|
||||
|
||||
- name: Build ⚙️
|
||||
run: npm run build
|
||||
|
||||
- name: Cypress run for Non-Forked PRs 🥬
|
||||
if: steps.pr_origin.outputs.is_forked == 'false'
|
||||
uses: cypress-io/github-action@v5
|
||||
with:
|
||||
env: SKIP_PREFLIGHT_CHECK=true
|
||||
install: false
|
||||
start: "npx vite preview --host"
|
||||
wait-on: "http://localhost:4000"
|
||||
wait-on-timeout: 300
|
||||
record: true
|
||||
parallel: true
|
||||
env:
|
||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
|
||||
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
|
||||
|
||||
- name: Cypress run for Forked PRs 🥬
|
||||
if: steps.pr_origin.outputs.is_forked == 'true'
|
||||
uses: cypress-io/github-action@v5
|
||||
with:
|
||||
env: SKIP_PREFLIGHT_CHECK=true
|
||||
install: false
|
||||
start: "npx vite preview --host"
|
||||
wait-on: "http://localhost:4000"
|
||||
wait-on-timeout: 300
|
||||
record: true
|
||||
parallel: true
|
||||
env:
|
||||
CYPRESS_SPLIT_TESTS: "true"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
|
||||
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
|
||||
SPLIT: ${{ strategy.job-total }}
|
||||
SPLIT_INDEX: ${{ strategy.job-index }}
|
||||
|
||||
- name: Upload cypress screenshots on failure 📸
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: cypress-screenshots
|
||||
path: cypress/screenshots
|
||||
|
||||
- name: Upload cypress videos 📹
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ failure() && steps.pr_origin.outputs.is_forked == 'true' }}
|
||||
with:
|
||||
name: cypress-videos
|
||||
path: cypress/videos
|
140
.github/workflows/deploy.yaml
vendored
Normal file
140
.github/workflows/deploy.yaml
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
name: Deploy Care Fe
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- staging
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- staging
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
IMAGE_NAME: care_fe
|
||||
AWS_DEFAULT_REGION: ap-south-1
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
EKS_CLUSTER_NAME: ${{ secrets.AWS_EKS_CLUSTER_NAME }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
if: github.repository == 'ohcnetwork/care_fe'
|
||||
runs-on: ubuntu-24.04-arm
|
||||
name: Test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-test-${{ hashFiles('package-lock.json', 'Dockerfile') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-test-
|
||||
|
||||
- name: Test build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
push: false
|
||||
provenance: false
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
build:
|
||||
needs: test
|
||||
if: github.ref == 'refs/heads/develop' || startsWith(github.event.ref, 'refs/tags/v')
|
||||
name: Build & Push to container registries
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Generate docker tags
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/${{ github.repository }}
|
||||
${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}
|
||||
tags: |
|
||||
type=raw,value=production-latest,enable=${{ startsWith(github.event.ref, 'refs/tags/v') }}
|
||||
type=raw,value=production-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ startsWith(github.event.ref, 'refs/tags/v') }}
|
||||
type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }}
|
||||
type=raw,value=staging-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ github.ref == 'refs/heads/staging' }}
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/develop' }}
|
||||
type=raw,value=latest-${{ github.run_number }},enable=${{ github.ref == 'refs/heads/develop' }}
|
||||
type=semver,pattern={{version}}
|
||||
flavor: |
|
||||
latest=false
|
||||
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-build-${{ hashFiles('package-lock.json', 'Dockerfile') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-build-
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
push: true
|
||||
provenance: false
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
notify-release:
|
||||
needs: build
|
||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||
name: Notify release
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- name: Notify release
|
||||
run: |
|
||||
echo "Release ${{ github.sha }} is ready to be deployed to production"
|
48
.github/workflows/issue-automation.yml
vendored
Normal file
48
.github/workflows/issue-automation.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: Automate Issues to Project
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- closed
|
||||
- assigned
|
||||
jobs:
|
||||
issue_opened_and_reopened:
|
||||
name: issue_opened_and_reopened
|
||||
runs-on: ubuntu-24.04-arm
|
||||
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'opened' || github.event.action == 'reopened'
|
||||
steps:
|
||||
- name: 'Move issue to "Triage"'
|
||||
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
|
||||
with:
|
||||
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
organization: ohcnetwork
|
||||
project_id: 4
|
||||
resource_node_id: ${{ github.event.issue.node_id }}
|
||||
status_value: "Triage"
|
||||
issue_closed:
|
||||
name: issue_closed
|
||||
runs-on: ubuntu-24.04-arm
|
||||
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'closed'
|
||||
steps:
|
||||
- name: 'Moved issue to "Done"'
|
||||
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
|
||||
with:
|
||||
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
organization: ohcnetwork
|
||||
project_id: 4
|
||||
resource_node_id: ${{ github.event.issue.node_id }}
|
||||
status_value: "Done"
|
||||
issue_assigned:
|
||||
name: issue_assigned
|
||||
runs-on: ubuntu-24.04-arm
|
||||
if: github.repository == 'ohcnetwork/care_fe' && github.event_name == 'issues' && github.event.action == 'assigned'
|
||||
steps:
|
||||
- name: 'Move issue to "In Progress"'
|
||||
uses: leonsteinhaeuser/project-beta-automations@v2.2.1
|
||||
with:
|
||||
gh_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
organization: ohcnetwork
|
||||
project_id: 4
|
||||
resource_node_id: ${{ github.event.issue.node_id }}
|
||||
status_value: "In Progress"
|
29
.github/workflows/label-merge-conflict.yml
vendored
Normal file
29
.github/workflows/label-merge-conflict.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: Auto Label Conflicts
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
pull_request:
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
auto-label:
|
||||
if: github.repository == 'ohcnetwork/care_fe'
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: prince-chrismc/label-merge-conflicts-action@v3
|
||||
with:
|
||||
conflict_label_name: "merge conflict"
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
max_retries: 5
|
||||
wait_ms: 15000
|
||||
detect_merge_changes: false
|
||||
conflict_comment: |
|
||||
Conflicts have been detected against the base branch. Please merge the base branch into your branch.
|
||||
cc: @${author}
|
||||
> _See: https://docs.ohc.network/docs/contributing#how-to-resolve-merge-conflicts_
|
33
.github/workflows/linter.yml
vendored
Normal file
33
.github/workflows/linter.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Lint Code Base
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
statuses: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run lint
|
||||
run: npm run lint -- --quiet
|
||||
|
||||
- name: Run unimported
|
||||
run: npm run unimported
|
88
.github/workflows/notify-non-core-qn.yml
vendored
Normal file
88
.github/workflows/notify-non-core-qn.yml
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
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-24.04-arm
|
||||
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@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const isOrgMember = (commenter, allowedUsers) =>
|
||||
allowedUsers.split(',').map(u => u.trim()).includes(commenter);
|
||||
|
||||
const containsQuestionKeywords = (text, keywords) =>
|
||||
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(Boolean);
|
||||
if (labels.length > 0) {
|
||||
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, commentUrl) => {
|
||||
const payload = { commentUrl };
|
||||
const response = await fetch(webhook, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`Slack notification failed with status: ${response.status}`);
|
||||
}
|
||||
};
|
||||
|
||||
const isBot = async (github, commenter) => {
|
||||
try {
|
||||
const { data: user } = await github.rest.users.getByUsername({ username: commenter });
|
||||
return user.type === 'Bot';
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const commenter = context.payload.comment.user.login;
|
||||
const allowedUsers = process.env.ALLOWED_USERNAMES;
|
||||
const keywords = process.env.QUESTION_KEYWORDS;
|
||||
const labels = process.env.QUESTION_LABELS;
|
||||
const webhook = process.env.SLACK_WEBHOOK;
|
||||
|
||||
if (await isBot(github, commenter)) return;
|
||||
|
||||
if (allowedUsers && !isOrgMember(commenter, allowedUsers)) {
|
||||
const commentBody = context.payload.comment.body.trim();
|
||||
const filteredCommentBody = commentBody.split('\n').filter(line => !line.startsWith('>')).join('\n');
|
||||
|
||||
if (keywords && containsQuestionKeywords(filteredCommentBody, keywords)) {
|
||||
if (labels) {
|
||||
await addLabelsToIssue(github, context, labels);
|
||||
}
|
||||
if (webhook) {
|
||||
const commentUrl = context.payload.comment.html_url;
|
||||
await sendSlackNotification(webhook, commentUrl);
|
||||
}
|
||||
}
|
||||
}
|
40
.github/workflows/ossar-analysis.yml
vendored
Normal file
40
.github/workflows/ossar-analysis.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
# This workflow integrates a collection of open source static analysis tools
|
||||
# with GitHub code scanning. For documentation, or to provide feedback, visit
|
||||
# https://github.com/github/ossar-action
|
||||
name: OSSAR
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
OSSAR-Scan:
|
||||
if: github.repository == 'ohcnetwork/care_fe'
|
||||
# OSSAR runs on windows-latest.
|
||||
# ubuntu-latest and macos-latest support coming soon
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
# Checkout your code repository to scan
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Run open source static analysis tools
|
||||
- name: Run OSSAR
|
||||
uses: github/ossar-action@v1
|
||||
id: ossar
|
||||
|
||||
# Upload results to the Security tab
|
||||
- name: Upload OSSAR results
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
|
59
.github/workflows/release.yml
vendored
Normal file
59
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
name: Create Release on Branch Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- production
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release on Push
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Necessary to fetch all tags
|
||||
|
||||
- name: Calculate next tag
|
||||
id: calc_tag
|
||||
run: |
|
||||
YEAR=$(date +"%y")
|
||||
WEEK=$(date +"%V")
|
||||
LAST_TAG=$(git tag -l "v$YEAR.$WEEK.*" | sort -V | tail -n1)
|
||||
LAST_TAG=$(echo "$LAST_TAG" | tr -d '\r' | sed 's/[[:space:]]*$//')
|
||||
echo "Last Tag: $LAST_TAG"
|
||||
if [[ $LAST_TAG == "" ]]; then
|
||||
MINOR=0
|
||||
else
|
||||
MINOR=$(echo $LAST_TAG | awk -F '.' '{print $NF}')
|
||||
echo "Minor Version: $MINOR"
|
||||
MINOR=$((MINOR + 1))
|
||||
fi
|
||||
TAG="v$YEAR.$WEEK.$MINOR"
|
||||
echo "TAG=$TAG" >> $GITHUB_ENV
|
||||
echo "Next Tag: $TAG"
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
|
||||
- name: Create and push tag
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git tag -a "$TAG" -m "Release $TAG"
|
||||
git push origin "$TAG"
|
||||
|
||||
- name: Create release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release create "$TAG" \
|
||||
--repo="$GITHUB_REPOSITORY" \
|
||||
--title="$TAG" \
|
||||
--generate-notes \
|
||||
--draft
|
21
.github/workflows/stale.yml
vendored
Normal file
21
.github/workflows/stale.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: "Close stale issues and PRs"
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 4 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
if: github.repository == 'ohcnetwork/care_fe'
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-label: "stale"
|
||||
stale-pr-label: "stale"
|
||||
exempt-issue-labels: "blocked,waiting for related PR,waiting for back end,help wanted,work-in-progress,In Progress,wishlist,EPIC,backlog"
|
||||
exempt-pr-labels: "tested,needs testing,need Review,waiting for related PR,waiting for back end,help wanted,blocked,work-in-progress,In Progress,backlog"
|
||||
days-before-issue-stale: 14
|
||||
days-before-pr-stale: 7
|
||||
days-before-issue-close: -1
|
||||
days-before-pr-close: -1
|
37
.github/workflows/thank-you.yml
vendored
Normal file
37
.github/workflows/thank-you.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Say thanks for the contributors
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- closed
|
||||
|
||||
jobs:
|
||||
if_merged:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-24.04-arm
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
contents: write
|
||||
steps:
|
||||
- name: Add thankyou note
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const thankyouNote = 'Your efforts have helped advance digital healthcare and TeleICU systems. :rocket: Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! :raised_hands:';
|
||||
const options = {
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
};
|
||||
|
||||
const { data : { assignees, user } } = await github.rest.issues.get(options);
|
||||
|
||||
const taggedUsers = [...new Set(
|
||||
assignees.map(u => "@"+u.login).concat("@"+user.login)
|
||||
)].join(" ")
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
...options,
|
||||
body: `${taggedUsers} ${thankyouNote}`
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user