Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit b08907b

Browse files
authored
Merge pull request #90 from DSpotDevelopers/fix/421-fix-websocket-issue-in-production
feat: enhance workflow with manual environment input and improved cha…
2 parents 9d321c0 + cebe6d0 commit b08907b

2 files changed

Lines changed: 44 additions & 10 deletions

File tree

.github/workflows/api-dependencies.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ on:
88
required: false
99
type: string
1010
default: ''
11+
workflow_dispatch:
12+
inputs:
13+
environment:
14+
description: 'Environment to deploy to'
15+
type: choice
16+
required: true
17+
default: 'staging'
18+
options:
19+
- staging
20+
- production
1121

1222
jobs:
1323
check-changes:
@@ -20,13 +30,20 @@ jobs:
2030
uses: actions/checkout@v3
2131
with:
2232
ref: ${{ inputs.ref || github.ref }}
23-
fetch-depth: 2
33+
fetch-depth: 0
2434

2535
- name: Check for changes in dependency files
2636
id: check-changes
2737
run: |
28-
# For manual triggers or workflow calls, check if files have changed in the last commit
29-
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
38+
# For manual triggers or workflow calls, check if files have changed
39+
if git rev-parse --verify HEAD^1 >/dev/null 2>&1; then
40+
# If we have a parent commit, compare with it
41+
CHANGED_FILES=$(git diff --name-only HEAD^1 HEAD)
42+
else
43+
# If this is the first commit or we're on a different branch
44+
# List all tracked files
45+
CHANGED_FILES=$(git ls-tree -r --name-only HEAD)
46+
fi
3047
# Define the pattern for dependency-related files
3148
DEPENDENCY_PATTERN="^package\.json$|^yarn\.lock$|^apps\/api\/package\.json$"
3249
DEPENDENCY_PATTERN="$DEPENDENCY_PATTERN|^packages\/(auth|common|config|contracts|core|plugin|utils)\/.*package\.json$"
@@ -56,8 +73,8 @@ jobs:
5673
needs: check-changes
5774
if: needs.check-changes.outputs.changes_detected == 'true'
5875
runs-on: ubuntu-latest
59-
# Determine environment based on ref (if tag or dev-dspot branch)
60-
environment: ${{ startsWith(github.ref, 'refs/tags/v') && 'production' || 'staging' }}
76+
# Determine environment based on manual input or ref
77+
environment: ${{ inputs.environment || (startsWith(github.ref, 'refs/tags/v') && 'production' || 'staging') }}
6178
permissions:
6279
contents: read
6380
id-token: write

.github/workflows/webapp-dependencies.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ on:
88
required: false
99
type: string
1010
default: ''
11+
workflow_dispatch:
12+
inputs:
13+
environment:
14+
description: 'Environment to deploy to'
15+
type: choice
16+
required: true
17+
default: 'staging'
18+
options:
19+
- staging
20+
- production
1121

1222
jobs:
1323
check-web-changes:
@@ -20,13 +30,20 @@ jobs:
2030
uses: actions/checkout@v3
2131
with:
2232
ref: ${{ inputs.ref || github.ref }}
23-
fetch-depth: 2
33+
fetch-depth: 0
2434

2535
- name: Check for changes in dependency files
2636
id: check-web-changes
2737
run: |
28-
# Formanual triggers or workflow calls, check if files have changed in the last commit
29-
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
38+
# For manual triggers or workflow calls, check if files have changed
39+
if git rev-parse --verify HEAD^1 >/dev/null 2>&1; then
40+
# If we have a parent commit, compare with it
41+
CHANGED_FILES=$(git diff --name-only HEAD^1 HEAD)
42+
else
43+
# If this is the first commit or we're on a different branch
44+
# List all tracked files
45+
CHANGED_FILES=$(git ls-tree -r --name-only HEAD)
46+
fi
3047
# Define the pattern for dependency-related files
3148
DEPENDENCY_PATTERN="^package\.json$|^yarn\.lock$|^apps\/gauzy\/package\.json$"
3249
DEPENDENCY_PATTERN="$DEPENDENCY_PATTERN|^packages\/(contracts|ui-auth|ui-config|ui-core)\/.*package\.json$"
@@ -56,8 +73,8 @@ jobs:
5673
needs: check-web-changes
5774
if: needs.check-web-changes.outputs.changes_detected == 'true'
5875
runs-on: ubuntu-latest
59-
# Determine environment based on ref (if tag or dev-dspot branch)
60-
environment: ${{ startsWith(github.ref, 'refs/tags/v') && 'production' || 'staging' }}
76+
# Determine environment based on manual input or ref
77+
environment: ${{ inputs.environment || (startsWith(github.ref, 'refs/tags/v') && 'production' || 'staging') }}
6178
permissions:
6279
contents: read
6380
id-token: write

0 commit comments

Comments
 (0)