@@ -140,6 +140,25 @@ jobs:
140
140
app_name : ${{ env.APP_NAME }}
141
141
org : ${{ env.CPLN_ORG }}
142
142
143
+ - name : Extract deployment URL
144
+ id : extract-url
145
+ run : |
146
+ RAILS_URL=$(echo "${{ steps.deploy.outputs.deployment_output }}" | grep -o 'https://rails-[^[:space:]]*\.cpln\.app')
147
+ echo "RAILS_URL=$RAILS_URL" >> $GITHUB_ENV
148
+ echo "rails_url=$RAILS_URL" >> $GITHUB_OUTPUT
149
+
150
+ - name : Update PR commit message
151
+ if : success()
152
+ env :
153
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
154
+ run : |
155
+ PR_SHA=$(gh pr view ${{ env.PR_NUMBER }} --json commits --jq '.commits[-1].oid')
156
+ git config user.name "GitHub Actions"
157
+ git config user.email "[email protected] "
158
+ git pull --rebase
159
+ git commit --amend -m "Rails review app deployed to ${{ env.RAILS_URL }}"
160
+ git push --force-with-lease origin HEAD
161
+
143
162
- name : Update deployment status success
144
163
if : success()
145
164
uses : actions/github-script@v7
@@ -148,7 +167,7 @@ jobs:
148
167
const message = `✅ Deployment successful!
149
168
Environment: review-app
150
169
Commit: ${context.sha.substring(0, 7)}
151
- URL: ${{ steps.deploy.outputs.app_url }}
170
+ URL: ${{ env.RAILS_URL }}
152
171
Status: ${process.env.statusUrl}`;
153
172
154
173
await github.rest.issues.createComment({
@@ -163,7 +182,7 @@ jobs:
163
182
repo: context.repo.repo,
164
183
deployment_id: ${{ steps.create-deployment.outputs.result }},
165
184
state: 'success',
166
- environment_url: '${{ steps.deploy.outputs.app_url }}',
185
+ environment_url: '${{ env.RAILS_URL }}',
167
186
description: 'Deployment successful'
168
187
});
169
188
0 commit comments