Skip to content

Commit 47bc906

Browse files
Initial commit
Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
0 parents  commit 47bc906

27 files changed

+2353
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Issue report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Issue Report
11+
12+
module-name: One line summary of the issue (less than 72 characters)
13+
14+
### Expected behavior
15+
16+
As concisely as possible, describe the expected behavior.
17+
18+
### Actual behavior
19+
20+
As concisely as possible, describe the observed behavior.
21+
22+
### Steps to reproduce the behavior
23+
24+
List all relevant steps to reproduce the observed behavior.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Metadata Field Addition
3+
about: Suggest a field to add to code.json schema
4+
title: "[METADATA]"
5+
labels: schema
6+
assignees: natalialuzuriaga
7+
8+
---
9+
10+
## Issue Report - Metadata
11+
12+
module-name: One line summary of the issue (less than 72 characters)
13+
14+
### Proposed Field information
15+
Fill out the information below on the new proposed field. Please refer to the structure of the code.json fields found here: https://github.com/DSACMS/codejson-generator/blob/main/schemas/schema-0.0.0.json
16+
17+
```
18+
"key-name-here": {
19+
"type": "____",
20+
"description": "One liner describing new field here"
21+
},
22+
```
23+
Provide example values here:
24+
25+
### Explanation
26+
27+
Describe more about the new field to add to code.json. Provide an explanation of why this field should be included and how its collection provides value to the agency.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!--
2+
Thank you for sending the PR! We appreciate you spending the time to work on
3+
these changes.
4+
5+
Help us understand your motivation by explaining why you decided to make this change.
6+
7+
Happy contributing!
8+
9+
- Comments should be formatted to a width no greater than 80 columns.
10+
11+
- Files should be exempt of trailing spaces.
12+
13+
- We adhere to a specific format for commit messages. Please write your commit
14+
messages along these guidelines. Please keep the line width no greater than 80
15+
columns (You can use `fmt -n -p -w 80` to accomplish this).
16+
17+
18+
-->
19+
20+
## module-name: One line description of your change (less than 72 characters)
21+
22+
## Problem
23+
24+
Explain the context and why you're making that change. What is the problem
25+
you're trying to solve? In some cases there is not a problem and this can be
26+
thought of being the motivation for your change.
27+
28+
## Solution
29+
30+
Describe the modifications you've done.
31+
32+
## Result
33+
34+
What will change as a result of your pull request? Note that sometimes this
35+
section is unnecessary because it is self-explanatory based on the solution.
36+
37+
Some important notes regarding the summary line:
38+
39+
- Describe what was done; not the result
40+
- Use the active voice
41+
- Use the present tense
42+
- Capitalize properly
43+
- Do not end in a period — this is a title/subject
44+
- Prefix the subject with its scope
45+
46+
## Test Plan
47+
48+
(Write your test plan here. If you changed any code, please provide us with
49+
clear instructions on how you verified your changes work.)
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/checks.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: "run-checks-and-deploy"
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: false
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-node@v4
23+
24+
- name: Setup GitHub pages
25+
uses: actions/configure-pages@v5
26+
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: ./
31+
32+
- name: Deploy to GitHub pages
33+
uses: actions/deploy-pages@v4
34+
35+
# resolve-repolinter-json:
36+
# uses: DSACMS/repo-scaffolder/.github/workflows/extendJSONFile.yml@main
37+
# with:
38+
# url_to_json: 'https://raw.githubusercontent.com/DSACMS/repo-scaffolder/main/tier3/%7B%7Bcookiecutter.project_slug%7D%7D/repolinter.json'
39+
40+
# repolinter-checks:
41+
# name: Tier 3 Checks
42+
# needs: resolve-repolinter-json
43+
# runs-on: ubuntu-latest
44+
# env:
45+
46+
# RAW_JSON: ${{ needs.resolve-repolinter-json.outputs.raw-json }}
47+
48+
# steps:
49+
# - uses: actions/checkout@v4
50+
# - run: echo $RAW_JSON > repolinter.json
51+
# - uses: newrelic/repolinter-action@v1
52+
# with:
53+
# # A path to the JSON/YAML Repolinter ruleset to use, relative to the workflow
54+
# # working directory (i.e. under `$GITHUB_WORKSPACE`).
55+
# #
56+
# # This option is mutually exclusive with config_url. If this option and
57+
# # config_url are not specified, Repolinter's default ruleset will be used.
58+
# config_file: 'repolinter.json'
59+
60+
# # Where repolinter-action should put the linting results. There are two
61+
# # options available:
62+
# # * "exit-code": repolinter-action will print the lint output to the console
63+
# # and set the exit code to result.passed. This output type is most useful for
64+
# # PR status checks.
65+
# # * "issue": repolinter-action will create a GitHub issue on the current
66+
# # repository with the repolinter output and always exit 0. See the README for
67+
# # more details on issue outputting behavior. This output type is ideal for
68+
# # non-intrusive notification.
69+
# #
70+
# # Default: "exit-code"
71+
# output_type: 'issue'
72+
73+
# # The title to use for the issue created by repolinter-action. This title
74+
# # should indicate the purpose of the issue, as well as that it was created by
75+
# # a bot.
76+
# #
77+
# # This option will be ignored if output_type != "issue".
78+
# #
79+
# # Default: "[Repolinter] Open Source Policy Issues"
80+
# output_name: '[Repolinter] Tier 3 Repository Hygiene Issue'
81+
82+
# # The default token is the repolinter token for the DSACMS org
83+
# # You can change it if needed.
84+
85+
# token: ${{ secrets.REPOLINTER_AUTO_TOKEN }}

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

0 commit comments

Comments
 (0)