-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/resolve vulnerability issues (#35)
* Update SDK to solve vulnerability issues Like deprecation of request package Solves: #30 #23 #21 Signed-off-by: Yonatan Kiron <yonatan.kiron@coralogix.com> * Change api endpoint to ingress as api is legacy Signed-off-by: Yonatan Kiron <yonatan.kiron@coralogix.com> * Add github action Signed-off-by: Yonatan Kiron <yonatan.kiron@coralogix.com> * Add proxy test example Signed-off-by: Yonatan Kiron <yonatan.kiron@coralogix.com> * Dist commit Signed-off-by: Yonatan Kiron <yonatan.kiron@coralogix.com> * Remove privateKey annotations Signed-off-by: Yonatan Kiron <yonatan.kiron@coralogix.com> --------- Signed-off-by: Yonatan Kiron <yonatan.kiron@coralogix.com>
- Loading branch information
1 parent
15cca62
commit 2e4eb74
Showing
42 changed files
with
753 additions
and
334 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
name: Bump Version | ||
|
||
# Avoid race conditions with tags release | ||
concurrency: nodejs-coralogix-sdk | ||
|
||
jobs: | ||
# CI is performed by ArgoCD | ||
push-tag: | ||
name: Push new tag | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate token | ||
id: generate-token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
github_api_url: https://api.github.com | ||
app_id: ${{ secrets.AUTOMATION_APP_ID }} | ||
private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }} | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
with: | ||
# Required so the tags can be detected | ||
fetch-depth: 0 | ||
github_token: ${{ steps.generate-token.outputs.token }} | ||
- name: Configure committer | ||
run: | | ||
git config --local user.email "121110262+coralogix-automation[bot]@users.noreply.github.com" | ||
git config --local user.name "coralogix-automation[bot]" | ||
git remote set-url origin https://coralogix-automation:${{ steps.generate-token.outputs.token }}@github.com/coralogix/nodejs-coralogix-sdk | ||
- name: Bump version | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
run: | | ||
npm install -g standard-version | ||
git checkout -b chore/${{ github.run_number }} | ||
standard-version --skip.tag | ||
npm run update-version | ||
git add . | ||
git commit -m "Created SDK version file" | ||
git push --follow-tags origin chore/${{ github.run_number }} | ||
gh pr create --base master --head chore/${{ github.run_number }} --fill | ||
gh api -XPOST /repos/coralogix/nodejs-coralogix-sdk/statuses/$(git rev-parse HEAD) -f state=success -f context="ticket-id-validator" | ||
gh api -XPOST /repos/coralogix/nodejs-coralogix-sdk/statuses/$(git rev-parse HEAD) -f state=success -f context="All Status Checks" | ||
gh pr merge --delete-branch --admin --squash chore/${{ github.run_number }} | ||
git checkout master | ||
git pull | ||
git tag v$(npm pkg get version | sed 's/"//g') | ||
git push --tags |
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,47 @@ | ||
name: Node.js Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
#change to this when you need to publish on pr level | ||
#on: | ||
# push: | ||
# branches: | ||
# - your-branch-name | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- uses: webfactory/ssh-agent@v0.8.0 | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build | ||
run: npm run build | ||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: https://registry.npmjs.org/ | ||
- uses: webfactory/ssh-agent@v0.8.0 | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build | ||
run: npm run build | ||
- name: Publish to npm | ||
working-directory: dist/libs/browser | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Node.js Test | ||
|
||
#change to this when you need to publish on pr level | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.js' | ||
- '**.ts' | ||
- .github/workflows/npm-test.yml | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
#- uses: webfactory/ssh-agent@v0.8.0 | ||
# with: | ||
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run tests | ||
run: npm run test |
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
Oops, something went wrong.