Skip to content

Commit 0764401

Browse files
committed
chore: update Github pipeline
1 parent 0d91be1 commit 0764401

10 files changed

+863
-989
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve CloudGraph
4+
title: ''
5+
labels: bug
6+
assignees: tyler-dunkel
7+
8+
---
9+
10+
Thank you for filling out a bug report, we really appreciate any help in improving the CloudGraph CLI and providers!
11+
12+
**Describe the bug**
13+
A clear and concise description of what the bug is.
14+
15+
**To Reproduce**
16+
Steps to reproduce the behavior:
17+
1. Run command '...' NOTE: please run the command in DEBUG mode for additional debugging info [e.g. `CG_DEBUG=5 cg scan aws`]
18+
2. Run GraphQL query '....'
19+
4. See error
20+
21+
Please include the `cg-debug.log` file if applicable
22+
23+
**Expected behavior**
24+
A clear and concise description of what you expected to happen.
25+
26+
**Environment (please complete the following information):**
27+
- CLI version [e.g. `0.11.7`]
28+
- Provider versions [e.g. `[email protected]`, `[email protected]`]
29+
- Context [e.g. Local machine, EC2 Instance, Other]
30+
31+
**Screenshots**
32+
If applicable, add screenshots to help explain your problem.
33+
34+
**Additional context**
35+
Add any other context about the problem here.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature request
3+
about: Suggest a feature you would like to see CloudGraph implement
4+
title: ''
5+
labels: enhancement
6+
assignees: tyler-dunkel
7+
8+
---
9+
10+
Thank you for taking the time to suggest a way the CloudGraph tool could imrpove!
11+
12+
If this is for a larger feature request, please use our [Slack channel](https://cloudgraph-workspace.slack.com) so we can discuss and avoid duplicate work (we may already be working on it!)
13+
.
14+
**Is your feature request related to a problem? Please describe.**
15+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
16+
17+
**Describe the solution you'd like**
18+
A clear and concise description of what you want to happen.
19+
20+
**Describe alternatives you've considered**
21+
A clear and concise description of any alternative solutions or features you've considered.
22+
23+
**How would this be useful to you**
24+
Tell us what this feature would help you achieve in your workflow
25+
26+
**Additional context**
27+
Add any other context or screenshots about the feature request here.

.github/SECURITY.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Security Policy
2+
3+
1. [Reporting security problems to CloudGraph](#reporting)
4+
2. [Security Point of Contact](#contact)
5+
3. [Incident Response Process](#process)
6+
7+
<a name="reporting"></a>
8+
## Reporting security problems to CloudGraph
9+
10+
**DO NOT CREATE AN ISSUE** to report a security problem. Instead, please
11+
send an email to [email protected]
12+
13+
<a name="contact"></a>
14+
## Security Point of Contact
15+
16+
The security point of contact is Tyler Dunkel. Tyler responds to security
17+
incident reports as fast as possible, within one business day at the latest.
18+
19+
In case Tyler does not respond within a reasonable time, the secondary point
20+
of contact is [Tyson Kunovsky](https://github.com/orgs/cloudgraphdev/people/kunovsky).
21+
22+
If neither Tyler nor Tyson responds then please contact [email protected]
23+
who can disable any access for the CloudGraph CLI tool until the security incident is resolved.
24+
25+
<a name="process"></a>
26+
## Incident Response Process
27+
28+
In case an incident is discovered or reported, CloudGraph will follow the following
29+
process to contain, respond and remediate:
30+
31+
### 1. Containment
32+
33+
The first step is to find out the root cause, nature and scope of the incident.
34+
35+
- Is still ongoing? If yes, first priority is to stop it.
36+
- Is the incident outside of my influence? If yes, first priority is to contain it.
37+
- Find out knows about the incident and who is affected.
38+
- Find out what data was potentially exposed.
39+
40+
One way to immediately remove all access for CloudGraph is to uninstall CloudGraph globally and/or locally using
41+
`npm uninstall -g @cloudgraph/cli` && `npm uninstall @cloudgraph/cli`
42+
43+
### 2. Response
44+
45+
After the initial assessment and containment to out best abilities, CloudGraph will
46+
document all actions taken in a response plan.
47+
48+
CloudGraph will create an RCA (Root Cause Analysis) document in the [CloudGraph documentation site](https://docs.cloudgraph.dev/overview) that describes what happened and what was done to resolve it.
49+
50+
### 3. Remediation
51+
52+
Once the incident is confirmed to be resolved, CloudGraph will summarize the lessons
53+
learned from the incident and create a list of actions CloudGraph will take to prevent
54+
it from happening again.
55+
56+
### Keep permissions to a minimum
57+
58+
The CloudGraph CLI tool uses the least amount of access to limit the impact of possible
59+
security incidents, see [README - How It Works](https://github.com/cloudgraphdev/cli#how-it-works).
60+
61+
### Secure accounts with access
62+
63+
The [CloudGraph GitHub Organization](https://github.com/cloudgraphdev) requires 2FA authorization
64+
for all members.
65+
66+
### Critical Updates And Security Notices
67+
68+
We learn about critical software updates and security threats from these sources
69+
70+
1. GitHub Security Alerts
71+
2. [Snyk open source vulnerability dectection](https://snyk.io/product/open-source-security-management/)
72+
3. GitHub: https://githubstatus.com/ & [@githubstatus](https://twitter.com/githubstatus)

.github/pull_request_template.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Issue tracker links
2+
3+
_Add links to any relevant tasks/stories/bugs/pagerduty/etc_
4+
5+
*Example - dummy TODO project*
6+
7+
[TODO-123](https://autoclouddev.atlassian.net/browse/TODO-123)
8+
9+
## Changes/solution
10+
11+
_How does this change address the problem?_
12+
13+
## Testing
14+
15+
_Describe how the testing was done, plus evidence, if not covered by automated tests_
16+
17+
## Notes and considerations
18+
19+
_Add any additional notes and/or considerations_
20+
21+
## Dependencies
22+
23+
_Add dependencies on any other PRs, if applicable

.github/workflows/notify.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: notify
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
notify:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 16
16+
- run: |
17+
GIT_COMMIT_TILE=$(git log -1 --pretty=format:"%s")
18+
curl -X POST --data-urlencode "payload={\"attachments\":[{\"fallback\":\"$GIT_AUTHOR_NAME released new $ORGANIZATION_NAME $REPO_NAME version of $GITHUB_REF_NAME\",\"color\":\"good\",\"title\":\"Version $GITHUB_REF_NAME of $ORGANIZATION_NAME $REPO_NAME released\",\"title_link\":\"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/$GITHUB_REF_NAME\",\"fields\":[{\"title\":\"Tag\",\"value\":\"<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commits/$GITHUB_REF_NAME|$GITHUB_REF_NAME>\",\"short\":true},{\"title\":\"Commit\",\"value\":\"<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$GITHUB_REF_NAME|$GIT_COMMIT_TILE>\",\"short\":true}],\"footer\":\"$ORGANIZATION_NAME $REPO_NAME \",\"ts\":\"$( date +%s )\"}]}" $SLACK_WEBHOOK
19+
env:
20+
REPO_NAME: ${{ github.event.repository.name }}
21+
GIT_AUTHOR_NAME: "AutoCloud Deploy Bot"
22+
SLACK_WEBHOOK: ${{secrets.slack_api_endpoint}}
23+
ORGANIZATION_NAME: ${{secrets.organization_name}}

.github/workflows/pr-validator.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: pr-validator
3+
4+
on:
5+
pull_request:
6+
types: [synchronize, opened, reopened, edited]
7+
branches:
8+
- main
9+
- beta
10+
11+
jobs:
12+
pr-validation:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- run: |
17+
if [ "$TARGET_BRANCH" == "main" ] && [ "$SOURCE_BRANCH" == "beta" ]; then
18+
echo "Merge from $SOURCE_BRANCH to $TARGET_BRANCH is valid"
19+
exit 0
20+
elif [ "$TARGET_BRANCH" == "beta" ] && [ "$SOURCE_BRANCH" == "alpha" ]; then
21+
echo "Merge from $SOURCE_BRANCH to $TARGET_BRANCH is valid"
22+
exit 0
23+
else
24+
echo "You cannot merge from $SOURCE_BRANCH to $TARGET_BRANCH"
25+
exit 1
26+
fi
27+
env:
28+
SOURCE_BRANCH: ${{ github.head_ref }}
29+
TARGET_BRANCH: ${{ github.base_ref }}

.github/workflows/publish.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: publish
3+
4+
on:
5+
push:
6+
branches:
7+
- alpha
8+
- beta
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
persist-credentials: false
19+
token: ${{secrets.gh_token}}
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
registry-url: "https://registry.npmjs.org"
24+
25+
- name: Get cache directory
26+
id: yarn-cache-dir
27+
run: |
28+
echo "::set-output name=dir::$(yarn cache dir)"
29+
30+
- name: Restoring cache
31+
uses: actions/cache@v3
32+
id: yarn-cache # use this to check for `cache-hit` ==> if: steps.yarn-cache.outputs.cache-hit != 'true'
33+
with:
34+
path: ${{ steps.yarn-cache-dir.outputs.dir }}
35+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-yarn-
38+
39+
- name: Install Packages
40+
# NOTE: The --ignore-scripts flag is required to prevent leakage of NPM_TOKEN value
41+
# See https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#use-private-packages
42+
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
43+
44+
- name: Build
45+
run: yarn prepack
46+
47+
- name: Test
48+
run: yarn lint
49+
50+
- name: Publish
51+
run: npx semantic-release
52+
env:
53+
NODE_ENV: "cicd"
54+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
55+
GITHUB_TOKEN: ${{secrets.gh_token}}
56+
GIT_AUTHOR_NAME: "autocloud-deploy-bot"
57+
GIT_AUTHOR_EMAIL: "[email protected]"
58+
GIT_COMMITTER_NAME: "autocloud-deploy-bot"
59+
GIT_COMMITTER_EMAIL: "[email protected]"

.releaserc.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
---
22
branches:
3+
- name: alpha
4+
channel: alpha
5+
prerelease: true
6+
- name: beta
7+
channel: beta
8+
prerelease: true
39
- name: main
10+
411
plugins:
512
- "@semantic-release/commit-analyzer"
613
- "@semantic-release/release-notes-generator"
714
- - "@semantic-release/changelog"
815
- changelogFile: CHANGELOG.md
916
- - "@semantic-release/git"
1017
- assets:
11-
- CHANGELOG.md
12-
- package.json
18+
- CHANGELOG.md
19+
- package.json
1320
- - "@semantic-release/npm"
1421
- npmPublish: true
15-
- "@semantic-release/gitlab"
22+
- "@semantic-release/github"
1623
verifyConditions:
1724
- "@semantic-release/changelog"
18-
- "@semantic-release/gitlab"
25+
- "@semantic-release/github"
1926
- "@semantic-release/npm"
2027
prepare:
2128
- "@semantic-release/changelog"
2229
- "@semantic-release/npm"
2330
- - "@semantic-release/git"
2431
- message: "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}"
2532
publish:
26-
- "@semantic-release/gitlab"
33+
- "@semantic-release/github"
2734
- "@semantic-release/npm"
2835
success: false
2936
fail: false

package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "CloudGraph provider plugin for GCP used to fetch GCP cloud data.",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/",
7-
"tag": "latest",
87
"access": "public"
98
},
109
"homepage": "https://www.cloudgraph.dev/",
@@ -67,10 +66,10 @@
6766
"@autocloud/eslint-config": "^0.1.0",
6867
"@graphql-codegen/cli": "2.4.0",
6968
"@graphql-codegen/typescript": "2.4.2",
70-
"@semantic-release/changelog": "^5.0.1",
71-
"@semantic-release/git": "^9.0.0",
72-
"@semantic-release/gitlab": "^6.2.2",
73-
"@semantic-release/npm": "^7.1.3",
69+
"@semantic-release/changelog": "^6.0.1",
70+
"@semantic-release/git": "^10.0.1",
71+
"@semantic-release/github": "^8.0.1",
72+
"@semantic-release/npm": "^9.0.1",
7473
"@types/jest": "^26.0.24",
7574
"@types/lodash": "^4.14.170",
7675
"@types/node": "^15.12.4",
@@ -87,7 +86,7 @@
8786
"jest": "^27.0.6",
8887
"lint-staged": "^11.1.1",
8988
"prettier": "^2.3.2",
90-
"semantic-release": "^17.4.4",
89+
"semantic-release": "^19.0.2",
9190
"shx": "^0.3.3",
9291
"ts-jest": "^27.0.4"
9392
},
@@ -97,4 +96,4 @@
9796
"git add --force"
9897
]
9998
}
100-
}
99+
}

0 commit comments

Comments
 (0)