freemium-survey-components 2.0.428 → 2.0.429
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/automated-version-bump.yml +288 -0
- package/.github/workflows/security_verification.yml +4 -3
- package/lib/bundle.css +2 -2
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/types/survey/meta-channel-preview/index.d.ts +1 -3
- package/lib/types/types.d.ts +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
name: Automated Version Bump and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version_type:
|
|
7
|
+
description: 'Version bump type'
|
|
8
|
+
required: true
|
|
9
|
+
default: 'patch'
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- patch
|
|
13
|
+
- minor
|
|
14
|
+
- major
|
|
15
|
+
push:
|
|
16
|
+
branches:
|
|
17
|
+
- main
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: write
|
|
21
|
+
pull-requests: write
|
|
22
|
+
packages: write
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
create-version-pr:
|
|
26
|
+
name: Create Version Bump PR
|
|
27
|
+
runs-on: fw-shared
|
|
28
|
+
if: github.event_name == 'workflow_dispatch'
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- name: Checkout code
|
|
32
|
+
uses: actions/checkout@v4
|
|
33
|
+
with:
|
|
34
|
+
fetch-depth: 0
|
|
35
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
+
persist-credentials: true
|
|
37
|
+
|
|
38
|
+
- name: Setup Node.js
|
|
39
|
+
uses: actions/setup-node@v4
|
|
40
|
+
with:
|
|
41
|
+
node-version: '18'
|
|
42
|
+
registry-url: 'https://registry.npmjs.org'
|
|
43
|
+
cache: 'npm'
|
|
44
|
+
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
run: npm ci
|
|
47
|
+
|
|
48
|
+
- name: Build library
|
|
49
|
+
run: npm run build
|
|
50
|
+
|
|
51
|
+
- name: Configure Git
|
|
52
|
+
run: |
|
|
53
|
+
git config --local user.email "survey-serv-ci@users.noreply.github.com"
|
|
54
|
+
git config --local user.name "Survey Serv Release Bot"
|
|
55
|
+
git config --local url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
|
|
56
|
+
|
|
57
|
+
- name: Get current version
|
|
58
|
+
id: current_version
|
|
59
|
+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
60
|
+
|
|
61
|
+
- name: Create feature branch
|
|
62
|
+
id: branch
|
|
63
|
+
run: |
|
|
64
|
+
BRANCH_NAME="version-bump-$(date +'%Y%m%d-%H%M%S')"
|
|
65
|
+
git checkout -b $BRANCH_NAME
|
|
66
|
+
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
|
|
67
|
+
|
|
68
|
+
- name: Bump version
|
|
69
|
+
id: version_bump
|
|
70
|
+
run: |
|
|
71
|
+
NEW_VERSION=$(npm version ${{ github.event.inputs.version_type }} --no-git-tag-version)
|
|
72
|
+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
73
|
+
echo "Bumped version from ${{ steps.current_version.outputs.version }} to $NEW_VERSION"
|
|
74
|
+
|
|
75
|
+
- name: Generate changes summary
|
|
76
|
+
id: changes
|
|
77
|
+
run: |
|
|
78
|
+
# Get commits since last tag for release notes
|
|
79
|
+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
80
|
+
if [ -z "$LAST_TAG" ]; then
|
|
81
|
+
CHANGES=$(git log --pretty=format:"- [%s](https://github.com/${{ github.repository }}/commit/%H)" --no-merges | head -10)
|
|
82
|
+
RELEASE_TYPE="Initial Release"
|
|
83
|
+
else
|
|
84
|
+
CHANGES=$(git log $LAST_TAG..HEAD --pretty=format:"- [%s](https://github.com/${{ github.repository }}/commit/%H)" --no-merges | head -10)
|
|
85
|
+
RELEASE_TYPE="Update"
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
echo "changes<<EOF" >> $GITHUB_OUTPUT
|
|
89
|
+
echo "$CHANGES" >> $GITHUB_OUTPUT
|
|
90
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
91
|
+
|
|
92
|
+
echo "release_type<<EOF" >> $GITHUB_OUTPUT
|
|
93
|
+
echo "$RELEASE_TYPE" >> $GITHUB_OUTPUT
|
|
94
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
95
|
+
|
|
96
|
+
- name: Commit version bump
|
|
97
|
+
run: |
|
|
98
|
+
git add package.json package-lock.json
|
|
99
|
+
git commit -m "chore: bump version to ${{ steps.version_bump.outputs.new_version }}
|
|
100
|
+
|
|
101
|
+
Version: ${{ steps.current_version.outputs.version }} → ${{ steps.version_bump.outputs.new_version }}
|
|
102
|
+
Type: ${{ github.event.inputs.version_type }}
|
|
103
|
+
|
|
104
|
+
Ready for automated publish after merge"
|
|
105
|
+
|
|
106
|
+
- name: Push feature branch
|
|
107
|
+
run: git push origin ${{ steps.branch.outputs.branch_name }}
|
|
108
|
+
|
|
109
|
+
- name: Create Pull Request
|
|
110
|
+
run: |
|
|
111
|
+
PR_URL=$(gh pr create \
|
|
112
|
+
--title "chore(release): bump version to ${{ steps.version_bump.outputs.new_version }}" \
|
|
113
|
+
--body "## Automated Version Bump: ${{ steps.version_bump.outputs.new_version }}
|
|
114
|
+
|
|
115
|
+
**Initiated by:** @${{ github.actor }}
|
|
116
|
+
**Workflow run:** [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
117
|
+
**Trigger:** Manual workflow dispatch
|
|
118
|
+
|
|
119
|
+
### Changes:
|
|
120
|
+
- **Version**: ${{ steps.current_version.outputs.version }} → ${{ steps.version_bump.outputs.new_version }}
|
|
121
|
+
- **Type**: ${{ github.event.inputs.version_type }}
|
|
122
|
+
- **Build**: Verified successful
|
|
123
|
+
|
|
124
|
+
### Recent commits:
|
|
125
|
+
${{ steps.changes.outputs.changes }}
|
|
126
|
+
|
|
127
|
+
### After Merge - Automatic Actions:
|
|
128
|
+
- npm package published
|
|
129
|
+
- Git tag created
|
|
130
|
+
- GitHub release created
|
|
131
|
+
|
|
132
|
+
**Merge this PR to trigger automated publishing!**" \
|
|
133
|
+
--head ${{ steps.branch.outputs.branch_name }} \
|
|
134
|
+
--base main)
|
|
135
|
+
|
|
136
|
+
echo "Pull request created: $PR_URL"
|
|
137
|
+
echo "Review and merge to complete: $PR_URL"
|
|
138
|
+
env:
|
|
139
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
140
|
+
|
|
141
|
+
publish-after-merge:
|
|
142
|
+
name: Publish After PR Merge
|
|
143
|
+
runs-on: fw-shared
|
|
144
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
145
|
+
|
|
146
|
+
steps:
|
|
147
|
+
- name: Checkout code
|
|
148
|
+
uses: actions/checkout@v4
|
|
149
|
+
with:
|
|
150
|
+
fetch-depth: 0
|
|
151
|
+
|
|
152
|
+
- name: Setup Node.js
|
|
153
|
+
uses: actions/setup-node@v4
|
|
154
|
+
with:
|
|
155
|
+
node-version: '18'
|
|
156
|
+
registry-url: 'https://registry.npmjs.org'
|
|
157
|
+
cache: 'npm'
|
|
158
|
+
|
|
159
|
+
- name: Check if this is a version bump commit
|
|
160
|
+
id: check_version
|
|
161
|
+
run: |
|
|
162
|
+
COMMIT_MSG=$(git log -1 --pretty=%s)
|
|
163
|
+
echo "Latest commit message: $COMMIT_MSG"
|
|
164
|
+
|
|
165
|
+
# Check commit message patterns (including merge commit messages)
|
|
166
|
+
COMMIT_MATCH=false
|
|
167
|
+
if echo "$COMMIT_MSG" | grep -q "chore: bump version to\|chore(release): bump version to\|Version Bump to\|bump version"; then
|
|
168
|
+
COMMIT_MATCH=true
|
|
169
|
+
fi
|
|
170
|
+
|
|
171
|
+
# Check the PR branch pattern in merge commit
|
|
172
|
+
PR_BRANCH_MATCH=false
|
|
173
|
+
if echo "$COMMIT_MSG" | grep -q "version-bump-[0-9]"; then
|
|
174
|
+
PR_BRANCH_MATCH=true
|
|
175
|
+
echo "Version bump branch pattern detected in merge"
|
|
176
|
+
fi
|
|
177
|
+
|
|
178
|
+
echo "Commit message match: $COMMIT_MATCH"
|
|
179
|
+
echo "PR branch match: $PR_BRANCH_MATCH"
|
|
180
|
+
|
|
181
|
+
if [ "$COMMIT_MATCH" = true ] || [ "$PR_BRANCH_MATCH" = true ]; then
|
|
182
|
+
echo "is_version_bump=true" >> $GITHUB_OUTPUT
|
|
183
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
184
|
+
echo "version=v$VERSION" >> $GITHUB_OUTPUT
|
|
185
|
+
echo "✅ Version bump detected: $VERSION"
|
|
186
|
+
echo "Reason: Commit=$COMMIT_MATCH, Branch=$PR_BRANCH_MATCH"
|
|
187
|
+
else
|
|
188
|
+
echo "is_version_bump=false" >> $GITHUB_OUTPUT
|
|
189
|
+
echo "❌ Not a version bump commit, skipping publish"
|
|
190
|
+
echo "Commit message: $COMMIT_MSG"
|
|
191
|
+
echo "No version bump indicators found"
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
- name: Install dependencies and build
|
|
195
|
+
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
196
|
+
run: |
|
|
197
|
+
npm ci
|
|
198
|
+
npm run build
|
|
199
|
+
|
|
200
|
+
- name: Publish to npm
|
|
201
|
+
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
202
|
+
run: |
|
|
203
|
+
echo "Publishing to npm..."
|
|
204
|
+
npm publish
|
|
205
|
+
echo "Successfully published to npm!"
|
|
206
|
+
env:
|
|
207
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
208
|
+
|
|
209
|
+
- name: Create Git tag
|
|
210
|
+
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
211
|
+
run: |
|
|
212
|
+
git config --local user.email "survey-serv-ci@users.noreply.github.com"
|
|
213
|
+
git config --local user.name "Survey Serv Release Bot"
|
|
214
|
+
git tag ${{ steps.check_version.outputs.version }}
|
|
215
|
+
git push origin ${{ steps.check_version.outputs.version }}
|
|
216
|
+
echo "Git tag created and pushed!"
|
|
217
|
+
|
|
218
|
+
- name: Cleanup version bump branch
|
|
219
|
+
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
220
|
+
run: |
|
|
221
|
+
# Extract branch name from merge commit message
|
|
222
|
+
COMMIT_MSG=$(git log -1 --pretty=%s)
|
|
223
|
+
echo "Commit message: $COMMIT_MSG"
|
|
224
|
+
|
|
225
|
+
# Extract branch name (e.g., version-bump-20250810-084452)
|
|
226
|
+
BRANCH_NAME=$(echo "$COMMIT_MSG" | grep -o 'version-bump-[0-9]\{8\}-[0-9]\{6\}' | head -1)
|
|
227
|
+
|
|
228
|
+
if [ -n "$BRANCH_NAME" ]; then
|
|
229
|
+
echo "Attempting to delete branch: $BRANCH_NAME"
|
|
230
|
+
|
|
231
|
+
# Delete the remote branch
|
|
232
|
+
if git push origin --delete "$BRANCH_NAME" 2>/dev/null; then
|
|
233
|
+
echo "✅ Successfully deleted remote branch: $BRANCH_NAME"
|
|
234
|
+
else
|
|
235
|
+
echo "⚠️ Branch $BRANCH_NAME may have been already deleted or doesn't exist"
|
|
236
|
+
fi
|
|
237
|
+
else
|
|
238
|
+
echo "ℹ️ Could not extract version bump branch name from commit message"
|
|
239
|
+
echo "Commit message was: $COMMIT_MSG"
|
|
240
|
+
fi
|
|
241
|
+
env:
|
|
242
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
243
|
+
|
|
244
|
+
- name: Generate release notes
|
|
245
|
+
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
246
|
+
id: release_notes
|
|
247
|
+
run: |
|
|
248
|
+
# Get commits since last tag (excluding current)
|
|
249
|
+
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
250
|
+
|
|
251
|
+
if [ -z "$LAST_TAG" ]; then
|
|
252
|
+
CHANGES=$(git log --pretty=format:"- [%s](https://github.com/${{ github.repository }}/commit/%H)" --no-merges HEAD^)
|
|
253
|
+
RELEASE_TYPE="Initial Release"
|
|
254
|
+
else
|
|
255
|
+
CHANGES=$(git log $LAST_TAG..HEAD^ --pretty=format:"- [%s](https://github.com/${{ github.repository }}/commit/%H)" --no-merges)
|
|
256
|
+
RELEASE_TYPE="Update"
|
|
257
|
+
fi
|
|
258
|
+
|
|
259
|
+
# Create release notes
|
|
260
|
+
cat > release_notes.md << EOF
|
|
261
|
+
## $RELEASE_TYPE
|
|
262
|
+
|
|
263
|
+
### Changes in this version:
|
|
264
|
+
$CHANGES
|
|
265
|
+
|
|
266
|
+
### Installation:
|
|
267
|
+
\`\`\`bash
|
|
268
|
+
npm install @gthangaraj-fr/react-button-library@${{ steps.check_version.outputs.version }}
|
|
269
|
+
\`\`\`
|
|
270
|
+
|
|
271
|
+
### Links:
|
|
272
|
+
- [npm Package](https://www.npmjs.com/package/@gthangaraj-fr/react-button-library)
|
|
273
|
+
- [Documentation](https://github.com/${{ github.repository }}/blob/main/README.md)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
*This release was automatically generated by GitHub Actions*
|
|
277
|
+
EOF
|
|
278
|
+
|
|
279
|
+
- name: Create GitHub Release
|
|
280
|
+
if: steps.check_version.outputs.is_version_bump == 'true'
|
|
281
|
+
run: |
|
|
282
|
+
gh release create ${{ steps.check_version.outputs.version }} \
|
|
283
|
+
--title "Release ${{ steps.check_version.outputs.version }}" \
|
|
284
|
+
--notes-file release_notes.md \
|
|
285
|
+
--latest
|
|
286
|
+
echo "GitHub release created!"
|
|
287
|
+
env:
|
|
288
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -6,7 +6,7 @@ name: Security Verification
|
|
|
6
6
|
on:
|
|
7
7
|
push:
|
|
8
8
|
branches:
|
|
9
|
-
-
|
|
9
|
+
- "**"
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
12
|
check-verify:
|
|
@@ -16,12 +16,12 @@ jobs:
|
|
|
16
16
|
- name: Check Repository
|
|
17
17
|
id: check-repo
|
|
18
18
|
run: |
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
AUTHORIZED_ORGS=()
|
|
21
21
|
while IFS= read -r line; do
|
|
22
22
|
AUTHORIZED_ORGS+=("$line")
|
|
23
23
|
done < <(curl -s https://codepot.freshpo.com/pattern)
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
match=false
|
|
26
26
|
|
|
27
27
|
CURRENT_REPO="${{ github.repository }}"
|
|
@@ -57,3 +57,4 @@ jobs:
|
|
|
57
57
|
ADDED: ${{ toJson(github.event.head_commit.added) }}
|
|
58
58
|
MODIFIED: ${{ toJson(github.event.head_commit.modified) }}
|
|
59
59
|
REMOVED: ${{ toJson(github.event.head_commit.removed) }}
|
|
60
|
+
|
package/lib/bundle.css
CHANGED
|
@@ -3955,7 +3955,7 @@ div.surveyserv-widget-container.compact-container-style .fsc-radio-group button.
|
|
|
3955
3955
|
font-family: var(--fsc-default-font-family);
|
|
3956
3956
|
padding: 8px 8px 16px 8px;
|
|
3957
3957
|
border-radius: 16px;
|
|
3958
|
-
max-width:
|
|
3958
|
+
max-width: 280px;
|
|
3959
3959
|
background-color: #f1f1f1;
|
|
3960
3960
|
display: flex;
|
|
3961
3961
|
flex-direction: column;
|
|
@@ -4196,7 +4196,7 @@ div.surveyserv-widget-container.compact-container-style .fsc-radio-group button.
|
|
|
4196
4196
|
}
|
|
4197
4197
|
.whatsapp-container .question-container {
|
|
4198
4198
|
max-width: var(--wa-message-width);
|
|
4199
|
-
margin-
|
|
4199
|
+
margin-inline-end: var(--wa-message-margin);
|
|
4200
4200
|
gap: 2px;
|
|
4201
4201
|
display: flex;
|
|
4202
4202
|
flex-direction: column;
|