-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(actions): added release action * feat(actions): add write all permission * feat(build): add lambda Dockerfile * feat(build): add goreleaser for lambda * feat(build): skip changelog for docker build * feat(actions): do not run build/repolinter on all push * feat(git): add git pre-commit hook * feat(build): Updated to work with pre-commit * feat(build): add pre-commit * feat(build): add gobin to path * feat(build): added commitlint * feat(build): run commitlint in validate action * feat(build): set fetch-depth to 2 * ci: add pull request template
- Loading branch information
1 parent
08ead4c
commit f9f4be5
Showing
16 changed files
with
209 additions
and
72 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,3 @@ max_line_length = 80 | |
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
### Feature Description | ||
A clear and concise description of the feature you want or need. | ||
|
||
### Describe Alternatives | ||
A clear and concise description of any alternative solutions or features you've considered. Are there examples you could link us to? | ||
|
||
### Additional context | ||
Add any other context here. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Description | ||
|
||
Please include a summary of the changes and the related issue. | ||
|
||
## Type of change | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing | ||
functionality to not work as expected) | ||
- [ ] This change requires a documentation update | ||
|
||
# How Has This Been Tested? | ||
|
||
Please describe the tests that you ran to verify your changes. | ||
|
||
- [ ] Test A | ||
- [ ] Test B | ||
|
||
# Checklist: | ||
|
||
- [ ] My code follows the style guidelines of this project | ||
- [ ] I have performed a self-review of my code | ||
- [ ] I have commented my code, particularly in hard-to-understand areas | ||
- [ ] I have made corresponding changes to the documentation | ||
- [ ] My changes generate no new warnings | ||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] New and existing unit tests pass locally with my changes |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This workflow will release a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Release | ||
|
||
permissions: write-all | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
|
||
- name: Generate new tag | ||
uses: obfu5c8/action-svu@v1 | ||
id: generate_next_version | ||
with: | ||
force-increment: true | ||
|
||
- name: Tag latest commit | ||
run: | | ||
git tag ${{ steps.generate_next_version.outputs.version }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This workflow will validate a golang project | ||
|
||
name: Validate | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
|
||
- name: Add GOBIN to PATH | ||
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
- name: Install staticcheck | ||
run: "go install 'honnef.co/go/tools/cmd/staticcheck@latest'" | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
- name: Install commitlint | ||
run: "npm install -g @commitlint/cli @commitlint/config-conventional" | ||
|
||
- name: Lint last commit message | ||
run: "commitlint --from HEAD~1 --to HEAD --verbose" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,4 +123,4 @@ config.yml | |
|
||
dist/ | ||
cf-params.json | ||
.build.env | ||
__tools/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
before: | ||
hooks: | ||
# You may remove this if you don't use go modules. | ||
- go mod tidy | ||
|
||
builds: | ||
- id: lambda | ||
main: ./cmd/nr-entity-tag-sync-lambda/nr-entity-tag-sync-lambda.go | ||
binary: nr-entity-tag-sync-lambda | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
|
||
archives: | ||
- format: binary | ||
|
||
dockers: | ||
- id: lambda-image | ||
ids: | ||
- lambda | ||
image_templates: | ||
- "{{ .Env.AWS_ECR_REPO_URI }}:latest" | ||
- "{{ .Env.AWS_ECR_REPO_URI }}:{{ .Tag }}" | ||
dockerfile: ./deployments/Dockerfile-lambda | ||
extra_files: | ||
- configs/config.yml | ||
|
||
changelog: | ||
skip: true | ||
|
||
release: | ||
disable: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
default_stages: | ||
- commit | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-byte-order-marker | ||
- id: check-executables-have-shebangs | ||
- id: check-json | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-yaml | ||
exclude: cf-template.yaml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- repo: https://github.com/Bahjat/pre-commit-golang | ||
rev: v1.0.3 | ||
hooks: | ||
- id: go-vet | ||
- id: go-unit-tests | ||
- id: go-static-check # install https://staticcheck.io/docs/ | ||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook | ||
rev: v9.5.0 | ||
hooks: | ||
- id: commitlint | ||
stages: | ||
- commit-msg | ||
additional_dependencies: ['@commitlint/config-conventional'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,3 @@ mappings: | |
sys_id: SNOW_CMDB_CI | ||
environment: SNOW_ENVIRONMENT | ||
sys_domain.value: SNOW_SYS_DOMAIN | ||
|
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
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