Skip to content

Commit 9b7a583

Browse files
committed
Create initial files from repo-scaffolder
1 parent 795244f commit 9b7a583

11 files changed

Lines changed: 613 additions & 0 deletions

.github/CODEOWNERS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Code Owners
2+
3+
<!-- TODO: Who are the points of contact in your project who are responsible/accountable for the project? This can often be an engineering or design manager or leader, who may or may not be the primary maintainers of the project. List them by GitHub Username-->
4+
5+
6+
- nolski
7+
- zungundp
8+
9+
10+
## Repo Domains
11+
12+
<!--
13+
The Repo Domains section of your CODEOWNERS.md file helps manage code review responsibilities efficiently. Each domain represents a different aspect of the repository, such as documentation, frontend, backend, DevOps, testing, etc. In this section, list each domain and assign the appropriate GitHub usernames or teams responsible for that domain. This ensures that pull requests (PRs) are reviewed by the right experts, maintaining high code quality and relevance.
14+
15+
For example:
16+
17+
/docs/ @doc-team @johnsmith @janedoe
18+
19+
/frontend/ @frontend-team @alice @bob
20+
21+
/backend/ @backend-team @charlie @dana
22+
23+
Furthermore, GitHub teams are a good feature for managing groups of contributors who need to be notified about specific domains within a repository. By creating and using GitHub teams, you can allow contributors to ping multiple relevant experts simultaneously.
24+
25+
To set up GitHub teams:
26+
27+
- Navigate to your organization's settings and select "Teams".
28+
- Create a new team for each domain, such as @frontend-team, @backend-team, or @doc-team.
29+
- Add the relevant members to each team. Ensure that the team includes all the individuals who should be notified about PRs in their domain.
30+
- When filling out the Repo Domains section in your CODEOWNERS.md file, use the team handles instead of or alongside individual usernames. This way, when a contributor opens a PR affecting a specific domain, they can simply tag the team, and every member of that team will be notified.
31+
32+
-->
33+
34+
/docs/ {Git usernames of documentation owners}
35+
/frontend/ {Git usernames of frontend owners}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Add Team to Repository Request Ticket
3+
about: Ticket for requesting team to be added to repository
4+
title: "[REQUEST]: "
5+
labels: # TODO: Add labels for categorization of requests
6+
assignees: # TODO: Add organization owner or help desk team
7+
---
8+
9+
## Request a New Team to be Added to a Repository
10+
11+
Please fill out the form below to request a new team to be added to a repository.
12+
13+
### Information Required
14+
15+
Team Name: <!-- Provide the team name you'd like to grant access to the repo -->
16+
Reason for Access: <!-- Provide a 1-2 sentence explanation for access -->
17+
18+
### Additional Notes (Optional)
19+
20+
<!-- Provide any additional context or requests -->
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Outside Collaborator Repository Access Request Ticket
3+
about: Ticket for requesting outside collaborator to be added to repository
4+
title: "[REQUEST]: "
5+
labels: # TODO: Add labels for categorization of requests
6+
assignees: # TODO: Add organization owner or help desk team
7+
---
8+
9+
## Request an outside collaborator to be added to repository
10+
11+
For individuals that are not members of the UNDP GitHub organization, these outside collaborators can request access to a repository. Fill out this issue to file the request or make a pull request to the `COMMUNITY.md` file, then a repository admin will grant access.
12+
13+
### Information Required
14+
15+
Name of individual:
16+
GitHub username:
17+
Role in project:
18+
Role in repository according to COMMUNITY.md (Maintainer, Approver, Reviewer):
19+
20+
### Additional Notes (Optional)
21+
22+
<!-- Provide any additional context or requests -->

.github/codejson/cookiecutter.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"project_name": "UNDP National Carbon Credit Registry",
3+
"project_repo_name": "undp-national-carbon-registry",
4+
"project_org": "UNDP",
5+
"description": "A short description of the project.",
6+
"long_description": "A longer description of the project.",
7+
"status": ["ideation", "development", "alpha", "beta", "release candidate", "production", "archival"],
8+
"license": ["CC0-1.0", "Apache-2.0", "MIT", "MPL-2.0", "GPL-2.0-only", "GPL-3.0-only", "GPL-3.0-or-later", "LGPL-2.1-only", "LGPL-3.0-only", "BSD-2-Clause", "BSD-3-Clause", "EPL-2.0", "Other"],
9+
"usage_type" : ["openSource", "governmentWideReuse", "exemptByLaw", "exemptByNationalSecurity", "exemptByAgencySystem", "exemptByAgencyMission", "exemptByCIO", "exemptByPolicyDate"],
10+
"repository_host": ["github.com/CMSgov", "github.com/CMS-Enterprise", "github.com/DSACMS", "github.cms.gov", "CCSQ GitHub"],
11+
"repository_visibility": ["public", "private"],
12+
"vcs": ["git", "hg", "svn", "rcs", "bzr"],
13+
"forks": 0,
14+
"platforms": "web, windows, mac, linux, ios, android, other",
15+
"categories": "healthcare",
16+
"software_type":["standalone/mobile", "standalone/iot", "standalone/desktop", "standalone/web", "standalone/backend", "standalone/other", "addon", "library", "configurationFiles"],
17+
"languages": "",
18+
"maintenance": ["internal", "contract", "community", "none"],
19+
"contract_number": 0,
20+
"tags": "dsacms-tier2",
21+
"contact_email": "opensource@cms.hhs.gov",
22+
"contact_name": "CMS Open Source Program Office",
23+
"feedback_mechanisms": "https://github.com/UNDP/undp-national-carbon-registry/issues",
24+
"localisation": ["true", "false"],
25+
"repository_type" : ["Package", "Website", "Standards", "Libraries", "Data", "Apps", "Tools", "APIs", "Docs"],
26+
"user_input": ["Yes", "No"],
27+
"fisma_level": ["Low", "Moderate", "High"],
28+
"group": "CMS/OA/DSAC",
29+
"projects": "",
30+
"systems": "",
31+
"upstream": "",
32+
"subset_in_healthcare": "Policy, Operational, Medicare, Medicaid",
33+
"user_type": "Providers, Patients, Government",
34+
"__prompts__": {
35+
"project_name": "What is the name of the project or software?",
36+
"project_repo_name": "What is the name of the repository?",
37+
"project_org": "What CMS GitHub organization is it under?",
38+
"description": "Provide a short description of the software. It should be a single line containing a single sentence. Maximum 150 characters are allowed.",
39+
"long_description": "Provide longer description of the software, between 150 and 10000 chars. It is meant to provide an overview of the capabilities of the software for a potential user.",
40+
"status": "What is the status of the project?",
41+
"license": "What license is the project under?",
42+
"usage_type": "What is the usage type for this project? For more information on each option, visit github.com/DSACMS/gov-codejson",
43+
"repository_host": "Where is the repository hosted?",
44+
"vcs": "What version control system is used?",
45+
"forks": "How many forks does the repository have?",
46+
"platforms": "What platform does the software runs on? Separate items by commas.",
47+
"categories": "What categories best describes the project? Separate items by commas. List of categories here: https://yml.publiccode.tools/categories-list.html?highlight=categories",
48+
"software_type": "What type of software is the project?",
49+
"languages": "What programming language(s) is the software written in? Separate items by commas.",
50+
"maintenance": "How is the software maintained?",
51+
"contract_number": "What is the contractor number of the project?",
52+
"tags": "Provide a list of tags to describe the software for search. Separate items by commas.",
53+
"contact_name": "A point of contact is needed for the project. What is the name of the point of contact?",
54+
"contact_email": "What is email address of the point of contact?",
55+
"feedback_mechanisms": "What are methods a repository receives feedback from the community (e.g. URL to GitHub repository issues page, website, email)",
56+
"localisation": "Does the software support multiple spoken languages?",
57+
"repository_type": "What type of repository is this project?",
58+
"user_input": "Does the project accept user input? (e.g. allows user to query a database, allows login by users, upload files, etc.)",
59+
"fisma_level": "What FISMA level is this project classified as? Learn more: https://security.cms.gov/learn/federal-information-security-modernization-act-fisma#perform-system-risk-categorization",
60+
"group": "Which group at CMS is the project part of?",
61+
"projects": "What project is the repository associated with? Separate items by commas.",
62+
"systems": "What systems does the repository use or interface with? Separate items by commas.",
63+
"upstream": "What upstream dependencies does the repository use? Separate items by commas.",
64+
"subset_in_healthcare": "Which subset of healthcare does the project belong to?",
65+
"user_type": "Who are the intended users?"
66+
}
67+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Changelog
2+
on:
3+
release:
4+
types:
5+
- created
6+
jobs:
7+
changelog:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: "Auto Generate changelog"
11+
uses: heinrichreimer/action-github-changelog-generator@v2.3
12+
with:
13+
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+

.github/workflows/contributors.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Update Contributors Information
2+
3+
on:
4+
workflow_dispatch: {}
5+
schedule:
6+
# Weekly on Saturdays.
7+
- cron: "30 1 * * 6"
8+
push:
9+
branches: [main]
10+
11+
jobs:
12+
update-contributors:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Update contributor list
25+
id: contrib_list
26+
uses: akhilmhdh/contributors-readme-action@v2.3.10
27+
env:
28+
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
with:
32+
readme_path: COMMUNITY.md
33+
use_username: false
34+
commit_message: "update contributors information"
35+
36+
- name: Get contributors count
37+
id: get_contributors
38+
env:
39+
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
43+
run: |
44+
OWNER=$(echo $GITHUB_REPOSITORY | cut -d'/' -f1)
45+
REPO=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)
46+
QUERY='query { repository(owner: \"'"$OWNER"'\", name: \"'"$REPO"'\") { collaborators { totalCount } } }'
47+
48+
CONTRIBUTORS=$(gh api \
49+
-H "Accept: application/vnd.github+json" \
50+
-H "X-GitHub-Api-Version: 2022-11-28" \
51+
"/repos/$OWNER/$REPO/contributors?per_page=100" | \
52+
jq '[.[] | select(.type != "Bot" and (.login | test("\\[bot\\]$") | not) and (.login | test("-bot$") | not))] | length')
53+
54+
echo "Total contributors: $CONTRIBUTORS"
55+
echo "contributors=$CONTRIBUTORS" >> $GITHUB_OUTPUT
56+
57+
58+
- name: Update COMMUNITY.md
59+
run: |
60+
61+
CONTRIBUTORS="${{ steps.get_contributors.outputs.contributors }}"
62+
63+
64+
perl -i -pe 's/(<!--CONTRIBUTOR COUNT START-->).*?(<!--CONTRIBUTOR COUNT END-->)/$1 '"$CONTRIBUTORS"' $2/' COMMUNITY.md
65+
66+
git config user.name 'github-actions[bot]'
67+
git config user.email 'github-actions[bot]@users.noreply.github.com'
68+
git add COMMUNITY.md
69+
git commit -m "update contributors count to $CONTRIBUTORS" || exit 0
70+
71+
- name: Push protected
72+
uses: CasperWA/push-protected@v2
73+
with:
74+
75+
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
76+
77+
78+
branch: main

.github/workflows/gitleaks.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Check for Secrets
2+
on:
3+
pull_request:
4+
push:
5+
6+
jobs:
7+
scan-for-secrets:
8+
name: Run gitleaks
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with: {fetch-depth: 0}
13+
14+
- name: Check for GitLeaks
15+
uses: gacts/gitleaks@v1
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: "Repository Hygiene Check"
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-first-run:
10+
name: Check For First Run
11+
runs-on: ubuntu-latest
12+
outputs:
13+
14+
should_run: ${{ steps.check.outputs.should_run }}
15+
16+
permissions:
17+
contents: read
18+
pull-requests: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
- id: check
22+
run: |
23+
# If manually triggered, always run
24+
25+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
26+
27+
echo "should_run=true" >> $GITHUB_OUTPUT
28+
exit 0
29+
fi
30+
31+
# Check if initialization label exists
32+
has_label=$(gh label list --json name | jq '.[] | select(.name=="repolinter-initialized")')
33+
34+
if [[ -z "$has_label" ]]; then
35+
# First time - create label and allow run
36+
gh label create repolinter-initialized --description "Marks repo as having run initial repolinter check"
37+
echo "should_run=true" >> $GITHUB_OUTPUT
38+
else
39+
echo "should_run=false" >> $GITHUB_OUTPUT
40+
fi
41+
env:
42+
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
46+
resolve-repolinter-json:
47+
name: Get Repolinter Config
48+
needs: check-first-run
49+
50+
if: needs.check-first-run.outputs.should_run == 'true'
51+
52+
uses: DSACMS/repo-scaffolder/.github/workflows/extendJSONFile.yml@main
53+
with:
54+
url_to_json: 'https://raw.githubusercontent.com/DSACMS/repo-scaffolder/main/tier2/%7B%7Bcookiecutter.project_slug%7D%7D/repolinter.json'
55+
56+
repolinter-checks:
57+
name: Tier 2 Checks
58+
needs: [check-first-run, resolve-repolinter-json]
59+
60+
if: needs.check-first-run.outputs.should_run == 'true'
61+
62+
runs-on: ubuntu-latest
63+
permissions:
64+
contents: write
65+
pull-requests: write
66+
env:
67+
68+
RAW_JSON: ${{ needs.resolve-repolinter-json.outputs.raw-json }}
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
- run: echo $RAW_JSON > repolinter.json
73+
- uses: DSACMS/repolinter-action@main
74+
with:
75+
config_file: 'repolinter.json'
76+
output_type: 'pull-request'
77+
pull_request_labels: 'repolinter-initialized, cms-oss, cms-gov'
78+
79+
token: ${{ secrets.REPOLINTER_AUTO_TOKEN }}
80+

0 commit comments

Comments
 (0)