freemium-survey-components 2.0.474 → 2.0.475

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.
@@ -21,13 +21,24 @@ permissions:
21
21
  pull-requests: write
22
22
  packages: write
23
23
 
24
+ # Bump this when you change the workflow file
25
+ env:
26
+ WORKFLOW_VERSION: '1.0.1'
27
+
24
28
  jobs:
25
29
  create-version-pr:
26
30
  name: Create Version Bump PR
27
31
  runs-on: fw-shared
28
32
  if: github.event_name == 'workflow_dispatch'
33
+ permissions:
34
+ contents: write
35
+ pull-requests: write
29
36
 
30
37
  steps:
38
+ - name: Log workflow version
39
+ run: |
40
+ echo "Workflow file version: ${{ env.WORKFLOW_VERSION }}"
41
+
31
42
  - name: Checkout code
32
43
  uses: actions/checkout@v4
33
44
  with:
@@ -101,8 +112,11 @@ jobs:
101
112
  run: git push origin ${{ steps.branch.outputs.branch_name }}
102
113
 
103
114
  - name: Create Pull Request
115
+ id: create_pr
104
116
  run: |
105
- PR_URL=$(gh pr create \
117
+ BRANCH="${{ steps.branch.outputs.branch_name }}"
118
+ PR_URL=""
119
+ if PR_URL=$(gh pr create \
106
120
  --title "chore(release): bump version to ${{ steps.version_bump.outputs.new_version }}" \
107
121
  --body "## Automated Version Bump: ${{ steps.version_bump.outputs.new_version }}
108
122
 
@@ -123,11 +137,24 @@ jobs:
123
137
  - GitHub release created
124
138
 
125
139
  **Merge this PR to trigger automated publishing!**" \
126
- --head ${{ steps.branch.outputs.branch_name }} \
127
- --base main)
128
-
129
- echo "Pull request created: $PR_URL"
130
- echo "Review and merge to complete: $PR_URL"
140
+ --head "$BRANCH" \
141
+ --base main 2>/dev/null); then
142
+ echo "PR created via gh pr create"
143
+ fi
144
+ if [ -z "$PR_URL" ]; then
145
+ PR_URL=$(gh pr list --head "$BRANCH" --json url --limit 1 -q '.[0].url' 2>/dev/null || true)
146
+ if [ -n "$PR_URL" ]; then
147
+ echo "PR already exists for branch; retrieved URL"
148
+ fi
149
+ fi
150
+ if [ -n "$PR_URL" ]; then
151
+ echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
152
+ echo "Pull request created: $PR_URL"
153
+ echo "Review and merge to complete: $PR_URL"
154
+ else
155
+ echo "::error::gh pr create failed and no PR found for branch $BRANCH. Enable GITHUB_TOKEN write access: Settings → Actions → General → Workflow permissions → Read and write permissions"
156
+ exit 1
157
+ fi
131
158
  env:
132
159
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133
160
 
@@ -137,6 +164,10 @@ jobs:
137
164
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
138
165
 
139
166
  steps:
167
+ - name: Log workflow version
168
+ run: |
169
+ echo "Workflow file version: ${{ env.WORKFLOW_VERSION }}"
170
+
140
171
  - name: Checkout code
141
172
  uses: actions/checkout@v4
142
173
  with:
@@ -281,11 +312,16 @@ jobs:
281
312
 
282
313
  - name: Notify Slack channel
283
314
  if: steps.check_version.outputs.is_version_bump == 'true'
315
+ continue-on-error: true
284
316
  run: |
317
+ if [ -z "$SLACK_WEBHOOK_URL" ]; then
318
+ echo "SLACK_WEBHOOK_URL secret not set; skipping Slack notification."
319
+ exit 0
320
+ fi
285
321
  RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ steps.check_version.outputs.version }}"
286
322
  PACKAGE_NAME=$(node -p "require('./package.json').name")
287
323
  MESSAGE=":tada: *New Release Published!* \nPackage: *${PACKAGE_NAME}* \nVersion: *${{ steps.check_version.outputs.version }}* \nReleased by: @${{ github.actor }} \n<${RELEASE_URL}|View Release Notes>"
288
- curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MESSAGE\"}" "${{ secrets.SLACK_WEBHOOK_URL }}"
324
+ curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MESSAGE\"}" "$SLACK_WEBHOOK_URL"
289
325
  echo "Slack notification sent!"
290
326
  env:
291
327
  SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-survey-components",
3
- "version": "2.0.474",
3
+ "version": "2.0.475",
4
4
  "description": "React Survey Ui Components",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",