This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
feat: Initial component generator #2
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
name: CI SWF OSCAL | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- ".gitignore" | |
- "LICENSE" | |
- "**/*.md" | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
create-and-update-swf-oscal: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Uses Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.20" | |
- name: Node and NPM | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- name: Download Component Generator | |
run: | | |
git clone https://github.com/defenseunicorns/component-generator.git | |
cd component-generator/ | |
make build | |
cd .. | |
- name: Create SWF OSCAL-Component File | |
run: ./component-generator/bin/component-generator aggregate --input .github/workflows/oscal/config-swf-oscal-component.yaml | |
- name: Clean Up | |
run: rm -rf component-generator | |
- name: Yaml Formatter and Cleanup | |
run: | | |
npm install --save-dev --save-exact prettier | |
npx prettier oscal-component.yaml --write | |
npm uninstall --save-dev prettier | |
rm -rf node_modules/ | |
rm package.json | |
rm package-lock.json | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
skip_checkout: true |