Skip to content

Commit 4eaa258

Browse files
Merge branch 'development' into feat/nested-global-fields
2 parents 7320c58 + 0212222 commit 4eaa258

60 files changed

Lines changed: 2913 additions & 2138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/issues-jira.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Create Jira Ticket for Github Issue
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
issue-jira:
9+
runs-on: ubuntu-latest
10+
steps:
11+
12+
- name: Login to Jira
13+
uses: atlassian/gajira-login@master
14+
env:
15+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
16+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
17+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
18+
19+
- name: Create Jira Issue
20+
id: create_jira
21+
uses: atlassian/gajira-create@master
22+
with:
23+
project: ${{ secrets.JIRA_PROJECT }}
24+
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
25+
summary: Github | Issue | ${{ github.event.repository.name }} | ${{ github.event.issue.title }}
26+
description: |
27+
*GitHub Issue:* ${{ github.event.issue.html_url }}
28+
29+
*Description:*
30+
${{ github.event.issue.body }}
31+
fields: "${{ secrets.ISSUES_JIRA_FIELDS }}"

.github/workflows/jira.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/policy-scan.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Checks the security policy and configurations
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security-policy:
7+
if: github.event.repository.visibility == 'public'
8+
runs-on: ubuntu-latest
9+
defaults:
10+
run:
11+
shell: bash
12+
steps:
13+
- uses: actions/checkout@master
14+
- name: Checks for SECURITY.md policy file
15+
run: |
16+
if ! [[ -f "SECURITY.md" || -f ".github/SECURITY.md" ]]; then exit 1; fi
17+
security-license:
18+
if: github.event.repository.visibility == 'public'
19+
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- uses: actions/checkout@master
25+
- name: Checks for License file
26+
run: |
27+
expected_license_files=("LICENSE" "LICENSE.txt" "LICENSE.md" "License.txt")
28+
license_file_found=false
29+
current_year=$(date +"%Y")
30+
31+
for license_file in "${expected_license_files[@]}"; do
32+
if [ -f "$license_file" ]; then
33+
license_file_found=true
34+
# check the license file for the current year, if not exists, exit with error
35+
if ! grep -q "$current_year" "$license_file"; then
36+
echo "License file $license_file does not contain the current year."
37+
exit 2
38+
fi
39+
break
40+
fi
41+
done
42+
43+
if [ "$license_file_found" = false ]; then
44+
echo "No license file found. Please add a license file to the repository."
45+
exit 1
46+
fi

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@ jobs:
1515
- uses: actions/setup-node@v4
1616
with:
1717
node-version: '22.x'
18-
cache: 'pnpm'
18+
19+
- name: Enable Corepack
20+
run: corepack enable
21+
22+
- name: Install pnpm
23+
run: corepack prepare pnpm@7 --activate
24+
25+
- name: Install root dependencies
26+
run: pnpm install
27+
1928
- name: Reading Configuration
2029
id: release_config
2130
uses: rgarcia-phi/json-to-variables@v1.1.0

.github/workflows/sast-scan.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/secrets-scan.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Secrets Scan
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security-secrets:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: '2'
12+
ref: '${{ github.event.pull_request.head.ref }}'
13+
- run: |
14+
git reset --soft HEAD~1
15+
- name: Install Talisman
16+
run: |
17+
# Download Talisman
18+
wget https://github.com/thoughtworks/talisman/releases/download/v1.37.0/talisman_linux_amd64 -O talisman
19+
20+
# Checksum verification
21+
checksum=$(sha256sum ./talisman | awk '{print $1}')
22+
if [ "$checksum" != "8e0ae8bb7b160bf10c4fa1448beb04a32a35e63505b3dddff74a092bccaaa7e4" ]; then exit 1; fi
23+
24+
# Make it executable
25+
chmod +x talisman
26+
- name: Run talisman
27+
run: |
28+
# Run Talisman with the pre-commit hook
29+
./talisman --githook pre-commit

.github/workflows/unit-test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ jobs:
2727
- name: Run tests for Contentstack Config
2828
working-directory: ./packages/contentstack-config
2929
run: npm run test
30+
31+
- name: Run tests for Contentstack Migrate RTE
32+
working-directory: ./packages/contentstack-migrate-rte
33+
run: npm run test
34+
35+
- name: Run tests for Contentstack Migration
36+
working-directory: ./packages/contentstack-migration
37+
run: npm run test
3038
# - name: Fetch latest references
3139
# run: |
3240
# git fetch --prune

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ packages/**/package-lock.json
1818
yarn.lock
1919
contents-*
2020
*.http
21-
*.todo
21+
*.todo
22+
talisman_output.log

.husky/pre-commit

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env sh
2+
# Pre-commit hook to run Talisman and Snyk scans, completing both before deciding to commit
3+
4+
# Function to check if a command exists
5+
command_exists() {
6+
command -v "$1" >/dev/null 2>&1
7+
}
8+
9+
# Check if Talisman is installed
10+
if ! command_exists talisman; then
11+
echo "Error: Talisman is not installed. Please install it and try again."
12+
exit 1
13+
fi
14+
15+
# Check if Snyk is installed
16+
if ! command_exists snyk; then
17+
echo "Error: Snyk is not installed. Please install it and try again."
18+
exit 1
19+
fi
20+
21+
# Allow bypassing the hook with an environment variable
22+
if [ "$SKIP_HOOK" = "1" ]; then
23+
echo "Skipping Talisman and Snyk scans (SKIP_HOOK=1)."
24+
exit 0
25+
fi
26+
27+
# Initialize variables to track scan results
28+
talisman_failed=false
29+
snyk_failed=false
30+
31+
# Run Talisman secret scan
32+
echo "Running Talisman secret scan..."
33+
talisman --githook pre-commit > talisman_output.log 2>&1
34+
talisman_exit_code=$?
35+
36+
if [ $talisman_exit_code -eq 0 ]; then
37+
echo "Talisman scan passed: No secrets found."
38+
else
39+
echo "Talisman scan failed (exit code $talisman_exit_code). See talisman_output.log for details."
40+
talisman_failed=true
41+
fi
42+
43+
# Run Snyk vulnerability scan (continues even if Talisman failed)
44+
echo "Running Snyk vulnerability scan..."
45+
snyk test --all-projects --fail-on=all > snyk_output.log 2>&1
46+
snyk_exit_code=$?
47+
48+
if [ $snyk_exit_code -eq 0 ]; then
49+
echo "Snyk scan passed: No vulnerabilities found."
50+
elif [ $snyk_exit_code -eq 1 ]; then
51+
echo "Snyk found vulnerabilities. See snyk_output.log for details."
52+
snyk_failed=true
53+
else
54+
echo "Snyk scan failed with error (exit code $snyk_exit_code). See snyk_output.log for details."
55+
snyk_failed=true
56+
fi
57+
58+
# Evaluate results after both scans
59+
if [ "$talisman_failed" = true ] || [ "$snyk_failed" = true ]; then
60+
echo "Commit aborted due to issues found in one or both scans."
61+
[ "$talisman_failed" = true ] && echo "- Talisman issues: Check talisman_output.log"
62+
[ "$snyk_failed" = true ] && echo "- Snyk issues: Check snyk_output.log"
63+
exit 1
64+
fi
65+
66+
# If both scans pass, allow the commit
67+
echo "All scans passed. Proceeding with commit."
68+
rm -f talisman_output.log snyk_output.log
69+
exit 0

.talismanrc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
fileignoreconfig:
2+
- filename: .github/workflows/secrets-scan.yml
3+
ignore_detectors:
4+
- filecontent
25
- filename: packages/contentstack-export/.env
36
checksum: b057ae11234ac9411fe5dfa54ac3b029a71db51b4c334dce8677ab6fc1e41ecf
47
- filename: packages/contentstack-export/test/integration/environments.test.js
@@ -85,10 +88,6 @@ fileignoreconfig:
8588
checksum: 1c1f05989f22d06b600fba7456c1935a385997292c770d573165b9a07e1a3b8a
8689
- filename: packages/contentstack-import/test/integration/auth-token-modules/webhooks.test.js
8790
checksum: f41c4c354482293e4d6e52923d451266b150ba675e61681e21ba83ebf5dd8382
88-
- filename: pnpm-lock.yaml
89-
checksum: 8bc914084e311432154f0e3bd05e2bbb60516460e09b9f8a6356c69d335b38b2
90-
- filename: package-lock.json
91-
checksum: 64cca4648257efc253c34babd3d857eadc2e4a42c8e84959f2005ec4dae0ed8a
9291
- filename: packages/contentstack-launch/src/commands/launch/environments.ts
9392
checksum: a9f5fc3fad1915ca8812f1159c4019b957db59f7b4c8e2da0d214e45b8835ef7
9493
- filename: packages/contentstack-launch/tsconfig.tsbuildinfo
@@ -109,4 +108,12 @@ fileignoreconfig:
109108
checksum: e345a745f027c76081df71e4fe9872c1f4adac076689b036e195b84041807b59
110109
- filename: packages/contentstack-launch/src/util/create-git-meta.ts
111110
checksum: 8cbd32dbbd2989c7c082f8a0b7615916125d211bce25531e9a882b8ebd5674af
112-
version: ""
111+
- filename: .husky/pre-commit
112+
checksum: b7cfe41015e9a2e2acb3a374389beddcd812d93bfceec90ce06dce54b0ed9e2b
113+
- filename: packages/contentstack/package.json
114+
checksum: 9b0fdd100effcdbb5ee3809f7f102bfd11c88dd76e49db5103434f3aa29473dd
115+
- filename: pnpm-lock.yaml
116+
checksum: fc379207a835de8d851caa256837e2a50e0278c43e0251372f2a5292bee41fac
117+
- filename: package-lock.json
118+
checksum: cb3fe940f63d80f600b479a3fc0fbf25201356628acf018119d6a8ba9c53e3c7
119+
version: ""

0 commit comments

Comments
 (0)