Skip to content

Commit

Permalink
refactor project
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbokvad committed Sep 26, 2023
2 parents 71cacce + be847ac commit 8921f82
Show file tree
Hide file tree
Showing 15,271 changed files with 3,446,791 additions and 60 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build
run-name: ${{ github.actor }} is testing out github actions
permissions:
contents: write
pages: write
id-token: write

on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci
- name: debug root
run: ls
- name: debug subfolder
run: cd src && ls
- name: Build
run: npm run build
- name: 'Run Compliance State'
uses: ./
with:
cydigConfigPath: ${{ github.workspace }}/src/cydigconfig.json
repo-token: ${{ secrets.MY_GITHUB_PAT}}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ __tests__/runner/*
.idea
.vscode
*.code-workspace

#dist
ResultsFile.xml
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
coverage/
coverage/
README.md
4 changes: 0 additions & 4 deletions CODEOWNERS

This file was deleted.

26 changes: 26 additions & 0 deletions LinitingAndFormat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How to install linting and format

1. Run the following commands (be in the root, if you don't have a package.json there, run npm init first to create one):

```yaml
npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin husky prettier --save-dev
npm pkg set scripts.prepare="husky install"
npm run prepare
```

2. Copy files: .eslintrc.json, .prettierignore, .prettierrc and .husky/pre-commit

3. Add following to script section in package.json:

```json
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --fix --ext .ts",
"format:write": "npx prettier -w .",
"format:check": "npx prettier -c .",
```

4. Make a commit. You should see that your files are being checked for rule breaks. If it does not work and you are using a Mac, run following command and try a new commit:

```yaml
chmod ug+x .husky/*
```
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
# CyDig Pipeline Tasks
# CyDig Compliance Action

This repository contains a action with compliance controls.

## Compliance Controls

The compliance controls that are currently available are listed below.

* Number of reviewers on a pull request
* Date of latest threat modeling
* Date of latest penetration test

## Development on already existing or new control.

1. To start development, create a branch named **feature/your-branch-name**.

2. Run the command below from the root.

```bash
npm install
```

By first running this command in the root you get the linting and format rules downloaded. So, every time you make a commit, a pre-hook will run to validate the rules. If there are any violation you will se an error or a warning in the terminal. Read more [here](/LinitingAndFormat.md). To fix format warnings run the following command from the **root**:

```bash
npm run format:write
```

3. If you are developing a new control, create a new folder for your control in the ```src``` folder.
4. Start developing. To compile your code, run the following command:



```bash
npm run build
```

5. To run the tests, run the following command:




```bash

npm run test
```

To generated test results in a XML-file, run the following command:



```bash

npm run testScript

```

If you don't have at least 1 test in the ```test``` folder, the workflow won't work.

6. If necessary, add input parameter in ```action.yml```, if it is needed for the control.
7. When pushing the code the repository the workflow will build and push your code to the repository.

This repository contains compliance tasks.
14 changes: 6 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: 'cydig/compliance@v1'
description: 'Provide a description here'
description: 'Cydig compliance action'
author: 'Jonathan'

# Define your inputs here.
# inputs:
# subscription:
# description: 'SubscriptionId to use for the connections in the custom task.'
# required: true
# default: 'Not working'
inputs:
cydigConfigPath:
description: 'The path to the json-file containing configuration for CyDig'
required: true
default: 'Not working'
repo-token:
description: 'SubscriptionId to use for the connections in the custom task.'
description: 'Personal access token to Github, permissions should be Code: read'
required: true
default: 'Not working'
runs:
Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/acorn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/browserslist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/eslint

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/eslint-config-prettier

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/eslint-ignore-errors

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/esparse

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/esvalidate

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/import-local-fixture

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/is-docker

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/is-inside-container

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/jest

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/js-yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/jsesc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/make-coverage-badge

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/ncc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/node-which

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/parser

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/prettier

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/resolve

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/rimraf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/tsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/tsserver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/update-browserslist-db

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8921f82

Please sign in to comment.