Skip to content

Commit

Permalink
Added GHA workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Sep 21, 2023
1 parent 96bb302 commit 659f44b
Show file tree
Hide file tree
Showing 41 changed files with 775 additions and 83 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# directory specific owners
* @david-waltermire-nist
11 changes: 11 additions & 0 deletions .github/CONTENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GitHub Files

This directory contains supporting files for GitHub repository use. The structure and contents of the directory are as follows:

* [CODEOWNERS](CODEOWNERS): Defines which individuals are responsible for code in this repository. See [GitHub code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).
* [dependabot.yml](dependabot.yml): Configures [Github Dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates) to manage security and version updates.
* [ISSUE_TEMPLATE](ISSUE_TEMPLATE): This directory contains several templates for creating new issues in GitHub.
* [issue_template.md](issue_template.md): Default issue template.
* [labels.json](labels.json): Configures the issue labels used by this repository. This is supported by the [labels workflow](workflows/labels.yml).
* [PULL_REQUEST_TEMPLATE.md](issue_template.md): This file contains a template to be filled out for each GitHub pull request by the person submitting it.
* [workflows](workflows): The configured [GHitHub actions workflows](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) for this repository.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# GitHub Issue Template Files

This directory contains templates for creating new project issues in GitHub. The structure and contents of the directory are as follows:

* [bug_report.md](bug_report.yaml): This file contains a template for creating a new issue in GitHub to report a bug.
* [question.md](question.yaml): This file contains a template for creating a new issue in GitHub containing a general question about the project.
* [feature_request.md](feature_request.yaml): This file contains a template for creating a new issue in GitHub containing a user story.
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug"]
projects: ["usnistgov/49"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: howto-replicate
attributes:
label: How do we replicate this issue?
description: What are the steps to reproduce this behavior (use screenshots if applicable)?
placeholder: |
1. Do this...
2. Then this...
3. See error...
validations:
required: true
- type: textarea
id: other
attributes:
label: Other relevant details
description: Anything else we should know?
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Feature request
description: Suggest an idea for this project
labels: ["user story", "enhancement"]
projects: ["usnistgov/49"]
body:
- type: textarea
id: user-story
attributes:
label: User Story
description: Describe why the new feature is needed.
placeholder: |
As a Vulntology *stakeholder*, I *provide a clear and concise description of what the problem is.* Ex. I need to be able to do
validations:
required: true
- type: textarea
id: goals
attributes:
label: Goals
description: Describe what needs to be accomplished to address the User Story.
placeholder: |
A clear and concise description of what you want to happen. This should be outcome focused. Include concise description of any alternative solutions or features you've considered. Feel free to include screenshots or examples about the feature request here.
validations:
required: true
- type: textarea
id: dependencies
attributes:
label: Dependencies
description: Describe any previous issues or related work that must be completed to start or complete this issue.
placeholder: |
Describe any previous issues or related work that must be completed to start or complete this issue.
validations:
required: false
- type: textarea
id: acceptance-criteria
attributes:
label: Acceptance Criteria
description: Describe the artifacts and additional work that must be completed to resolve this issue.
placeholder: |
Describe anything else that must be completed for this issue to be considered resolved.
validations:
required: false
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Question
description: Ask your question
labels: ['question']
body:
- type: markdown
attributes:
value: Please note, the [Q&A discussion board](https://github.com/usnistgov/vulntology/discussions/categories/q-a) is a more appropriate place for asking most questions.
- type: textarea
id: question-text
attributes:
label: Question
description: Please enter your question
validations:
required: true
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Committer Notes

{Please provide a brief description of what this PR accomplishes. Be sure to reference any issues addressed. If the PR is a work-in-progress submitted for early review, please mark the PR as DRAFT.}

## All Submissions:

- [ ] Have you selected the correct base branch per [Contributing](https://github.com/usnistgov/vulntology/blob/main/CONTRIBUTING.md) guidance?
- [ ] Have you set "[Allow edits and access to secrets by maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)"?
- [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/usnistgov/vulntology/pulls) for the same update/change?
- [ ] Have you squashed any non-relevant commits and commit messages? \[[instructions](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)\]

By submitting a pull request, you are agreeing to provide this contribution under the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/).

## For Changes

- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your core changes, as applicable?
- [ ] Have you included examples of how to use your new feature(s)?
- [ ] Have you updated all [website](https://pages.nist.gov/vulntology) and readme documentation affected by the changes you made? Changes to the website can be made in the `website/content` directory of your branch.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: "develop"
- package-ecosystem: "gomod"
directory: "/website"
schedule:
interval: "daily"
target-branch: "develop"
- package-ecosystem: "npm"
directory: /
schedule:
interval: "daily"
target-branch: "develop"
1 change: 1 addition & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{Please describe the nature of your issue}
12 changes: 12 additions & 0 deletions .github/labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{ "name": "bug", "color":"d73a4a", "description":"The issue is a bug report."},
{ "name": "documentation", "color":"0075ca", "description":"The issue relates to improvements of additions to documentation."},
{ "name": "duplicate", "color":"cfd3d7", "description":"The issue duplicates another issue."},
{ "name": "enhancement", "color":"a2eeef", "description":"The issue adds a new feature, capability, or artifact to the repository."},
{ "name": "good first issue", "color":"7057ff", "description":"Good issue for newcomers to work on."},
{ "name": "help wanted", "color":"008672", "description":"Help from the community is needed with this issue."},
{ "name": "invalid", "color":"e4e669", "description":"The issue is not resolvable in any way."},
{ "name": "question", "color":"d876e3", "description":"The issue contains a question that needs to be answered."},
{ "name": "user story", "color":"73b3e7", "description":"The issue is a user story for a development task."},
{ "name": "wontfix", "color":"ffffff", "description":"The issue will not be addressed."}
]
1 change: 1 addition & 0 deletions .github/workflows/config/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HUGO_VERSION=0.118.2
2 changes: 2 additions & 0 deletions .github/workflows/config/.lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://search.usa.gov/search
https://github.com/usnistgov/hugo-uswds/tree/master/website/content/*
34 changes: 34 additions & 0 deletions .github/workflows/config/.markdown-link-check/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"ignorePatterns": [
{
"pattern": "https://docs.github.com"
},
{
"pattern": "https://guides.github.com"
},
{
"pattern": "https://help.github.com"
},
{
"pattern": "https://www.bottlecaps.de/rex/"
}
],
"replacementPatterns": [
{
"pattern": "^../../issues",
"replacement": "https://github.com/usnistgov/hugo-uswds/issues"
},
{
"pattern": "^../../projects",
"replacement": "https://github.com/usnistgov/hugo-uswds/projects"
},
{
"pattern": "^../../releases",
"replacement": "https://github.com/usnistgov/hugo-uswds/releases"
},
{
"pattern": "^../../tree",
"replacement": "https://github.com/usnistgov/hugo-uswds/tree"
}
]
}
1 change: 1 addition & 0 deletions .github/workflows/config/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
36 changes: 0 additions & 36 deletions .github/workflows/generate-website.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
label:
types: [created,deleted,edited]
push:
branches:
- main
paths:
- '.github/labels.json'
name: Create Default Labels
jobs:
labels:
name: DefaultLabelsActions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- uses: lannonbr/issue-label-manager-action@7890981d0e8f2922211a7fe2c391c53cb3037cb4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Link Check

on:
schedule:
- cron: "00 8 * * *" # 0800 UTC is 0400 AM EDT
repository_dispatch:
workflow_dispatch:
inputs:
ignorePattern:
description: 'a pattern provided to grep for files/directories to ignore'
required: false
default: '^website/'
type: string
markdownLinkCheckConfig:
description: 'the path to the markdown link check config file'
required: false
default: 'build/config/.markdown-link-check/config.json'
type: string
site_git_ref:
description: 'git ref, a SHA commit or branch or tag, for the published HTML content'
required: true
default: 'nist-pages'
type: string
site_git_ref_path:
description: 'the subdirectory to check out git ref and check links in website content'
required: true
default: 'published'
type: string
linkcheck_create_issue:
description: 'create new GitHub issue if broken links found'
required: false
default: true
type: boolean
jobs:
schedule-validate-repo-markdown-links:
uses: ./.github/workflows/workflow-validate-repo-markdown.yml
if: github.event_name != 'workflow_dispatch'
with:
ignorePattern: '^website/'
markdownLinkCheckConfig: 'build/config/.markdown-link-check/config.json'
linkcheck_create_issue: true
schedule-validate-repo-markdown-links-debug:
uses: ./.github/workflows/workflow-validate-repo-markdown.yml
if: github.event_name == 'workflow_dispatch'
with:
ignorePattern: ${{ github.event.inputs.ignorePattern }}
markdownLinkCheckConfig: ${{ github.event.inputs.markdownLinkCheckConfig }}
linkcheck_create_issue: ${{ contains('true', github.event.inputs.linkcheck_create_issue) }}
schedule-validate-website-links:
uses: ./.github/workflows/workflow-validate-website-content.yml
if: github.event_name != 'workflow_dispatch'
with:
site_git_ref: 'nist-pages'
site_git_ref_path: 'published'
linkcheck_create_issue: true
schedule-validate-website-links-debug:
uses: ./.github/workflows/workflow-validate-website-content.yml
if: github.event_name == 'workflow_dispatch'
with:
site_git_ref: ${{ github.event.inputs.site_git_ref }}
site_git_ref_path: ${{ github.event.inputs.site_git_ref_path }}
linkcheck_create_issue: ${{ contains('true', github.event.inputs.linkcheck_create_issue) }}
28 changes: 28 additions & 0 deletions .github/workflows/status-ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Metaschema CI/CD
on:
push:
branches:
- main
- develop
- "feature-*"
- "release-*"
pull_request:
branches:
- main
- develop
- "feature-*"
- "release-*"
workflow_dispatch:
jobs:
validate-repo-markdown:
uses: ./.github/workflows/workflow-validate-repo-markdown.yml
validate-website:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/workflow-generate-website.yml
with:
commit_resources: false
push-website:
if: github.event_name == 'push'
uses: ./.github/workflows/workflow-generate-website.yml
with:
commit_resources: true
Loading

0 comments on commit 659f44b

Please sign in to comment.