Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devfix/cs 43960 #1310

Merged
merged 10 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on:
pull_request:
types: [opened]
jobs:
security:
security-jira:
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v2
- name: Login into JIRA
uses: atlassian/gajira-login@master
env:
Expand All @@ -26,3 +26,8 @@ jobs:
PR: ${{ github.event.pull_request.html_url }}

fields: "${{ secrets.JIRA_FIELDS }}"
- name: Transition issue
uses: atlassian/gajira-transition@v3
with:
issue: ${{ steps.create.outputs.issue }}
transition: ${{ secrets.JIRA_TRANSITION }}
11 changes: 11 additions & 0 deletions .github/workflows/sast-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: SAST Scan
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-sast:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Semgrep Scan
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}:/src" returntocorp/semgrep semgrep scan --config auto
12 changes: 1 addition & 11 deletions .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@ on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security:
security-sca:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js 18.x
uses: actions/[email protected]
with:
node-version: '18.x'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/secrets-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Secrets Scan
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Expect, jq and Python
run: sudo apt-get update --fix-missing && sudo apt-get install -y expect jq python3 python3-pip wkhtmltopdf

- name: Install Python packages
run: pip install pandas json2html tabulate

- name: Install Talisman
run: |
curl --silent https://raw.githubusercontent.com/thoughtworks/talisman/v1.32.0/install.sh > install.bash
chmod +x install.bash
./install.bash

- name: Run Talisman
id: run_talisman
run: /usr/local/bin/talisman --scan
continue-on-error: true

- name: Convert JSON to HTML
run: |
python3 -c "
import json
import os
from json2html import *
with open('talisman_report/talisman_reports/data/report.json') as f:
data = json.load(f)
html = json2html.convert(json = data)
os.makedirs('talisman_html_report', exist_ok=True)
with open('talisman_html_report/report.html', 'w') as f:
f.write(html)
" && wkhtmltopdf talisman_html_report/report.html talisman_report.pdf

- name: Upload Report
id: upload_report
uses: actions/upload-artifact@v4
with:
name: talisman-report-pdf
path: talisman_report.pdf

- name: Check the status of talisman scan
run: |
# if [[ ${{ steps.run_talisman.outcome }} == "success" ]]; then exit 0; else echo "Download the Talisman scan report from Artifact: ${{ steps.upload_report.outputs.artifact-url }}" && exit 1; fi
echo "Download the Talisman scan report from Artifact: ${{ steps.upload_report.outputs.artifact-url }}";
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-bootstrap/1.8.0 darwin-arm64 node-v18.19.0
@contentstack/cli-cm-bootstrap/1.8.0 darwin-arm64 node-v20.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bulk-publish",
"description": "Contentstack CLI plugin for bulk publish actions",
"version": "1.4.0",
"version": "1.4.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async function publishEntry(data, _config, queue) {
.publish({
publishDetails: { environments: entryObj.environments, locales: lang },
locale: entryObj.locale || 'en-us',
version: entryObj.version
})
.then((publishEntryResponse) => {
if (!publishEntryResponse.error_message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async function bulkAction(stack, items, bulkPublish, filter, destEnv, apiVersion
uid: items[index].data.uid,
content_type: items[index].content_type_uid,
locale: items[index].data.locale || 'en-us',
version: items[index].data._version,
publish_details: [items[index].data.publish_details] || [],
});
}
Expand Down Expand Up @@ -110,7 +111,9 @@ async function bulkAction(stack, items, bulkPublish, filter, destEnv, apiVersion
publish_details: [items[index].data.publish_details],
environments: destEnv,
entryUid: items[index].data.uid,
version: items[index].data._version,
locale: items[index].data.locale || 'en-us',
version: items[index].data._version,
Type: 'entry',
stack: stack,
});
Expand Down
2 changes: 2 additions & 0 deletions packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ EXAMPLES

$ csdx config:set:region AZURE-EU

$ csdx config:set:region GCP-NA

$ csdx config:set:region --cma <contentstack_cma_endpoint> --cda <contentstack_cda_endpoint> --ui-host <contentstack_ui_host_endpoint> --name "India"
```

Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.14.0",
"version": "1.14.1",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run"
Expand All @@ -26,7 +26,7 @@
"@contentstack/cli-auth": "~1.3.17",
"@contentstack/cli-cm-bootstrap": "~1.9.0",
"@contentstack/cli-cm-branches": "~1.0.22",
"@contentstack/cli-cm-bulk-publish": "~1.4.0",
"@contentstack/cli-cm-bulk-publish": "~1.4.1",
"@contentstack/cli-cm-export": "~1.11.0",
"@contentstack/cli-cm-clone": "~1.10.1",
"@contentstack/cli-cm-export-to-csv": "~1.7.0",
Expand Down
Loading