@@ -141,48 +141,17 @@ jobs:
141
141
org : ${{ env.CPLN_ORG }}
142
142
github_token : ${{ secrets.GITHUB_TOKEN }}
143
143
144
- - name : Update PR commit message
145
- if : success()
146
- env :
147
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
148
- RAILS_URL : ${{ steps.deploy.outputs.rails_url }}
149
- run : |
150
- if [ -n "$RAILS_URL" ]; then
151
- echo "🔄 Updating PR commit message with deployment URL..."
152
- PR_SHA=$(gh pr view ${{ env.PR_NUMBER }} --json commits --jq '.commits[-1].oid')
153
- if [ -n "$PR_SHA" ]; then
154
- git config user.name "GitHub Actions"
155
- git config user.email "[email protected] "
156
- git pull --rebase
157
- git commit --amend -m "Rails review app deployed to $RAILS_URL"
158
- if git push --force-with-lease origin HEAD; then
159
- echo "✅ Successfully updated commit message"
160
- else
161
- echo "❌ Failed to push updated commit message"
162
- exit 1
163
- fi
164
- else
165
- echo "❌ Failed to get PR SHA"
166
- exit 1
167
- fi
168
- else
169
- echo "❌ No Rails URL found in deployment output"
170
- exit 1
171
- fi
172
-
173
- - name : Update deployment status success
144
+ - name : Post deployment status
174
145
if : success()
175
146
uses : actions/github-script@v7
176
147
env :
177
148
RAILS_URL : ${{ steps.deploy.outputs.rails_url }}
178
149
with :
179
150
script : |
180
151
const message = `✅ Deployment successful!
181
-
182
- Environment: review-app
183
- Commit: ${context.sha.substring(0, 7)}
184
- Rails URL: ${process.env.RAILS_URL}
185
- Workflow Status: ${process.env.statusUrl}`;
152
+
153
+ 🚀 Rails app: ${process.env.RAILS_URL}
154
+ 📊 Status: ${process.env.statusUrl}`;
186
155
187
156
await github.rest.issues.createComment({
188
157
issue_number: context.issue.number || context.payload.pull_request.number,
@@ -200,17 +169,15 @@ jobs:
200
169
description: '✅ Deployment successful'
201
170
});
202
171
203
- - name : Update deployment status failure
172
+ - name : Post deployment failure
204
173
if : failure()
205
174
uses : actions/github-script@v7
206
- env :
207
- RAILS_URL : ${{ steps.deploy.outputs.rails_url }}
208
175
with :
209
176
script : |
210
177
const message = `❌ Deployment failed
211
-
212
- Commit: ${context.sha.substring(0, 7)}
213
- Workflow Status: ${process.env.statusUrl}`;
178
+
179
+ Commit : ${context.sha.substring(0, 7)}
180
+ Workflow Status : ${process.env.statusUrl}`;
214
181
215
182
await github.rest.issues.createComment({
216
183
issue_number : context.issue.number || context.payload.pull_request.number,
0 commit comments