Skip to content

Commit 4970fbe

Browse files
committed
fixes
1 parent 87662fa commit 4970fbe

File tree

1 file changed

+8
-41
lines changed

1 file changed

+8
-41
lines changed

.github/workflows/deploy-to-control-plane-review.yml

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -141,48 +141,17 @@ jobs:
141141
org: ${{ env.CPLN_ORG }}
142142
github_token: ${{ secrets.GITHUB_TOKEN }}
143143

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
174145
if: success()
175146
uses: actions/github-script@v7
176147
env:
177148
RAILS_URL: ${{ steps.deploy.outputs.rails_url }}
178149
with:
179150
script: |
180151
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}`;
186155
187156
await github.rest.issues.createComment({
188157
issue_number: context.issue.number || context.payload.pull_request.number,
@@ -200,17 +169,15 @@ jobs:
200169
description: '✅ Deployment successful'
201170
});
202171
203-
- name: Update deployment status failure
172+
- name: Post deployment failure
204173
if: failure()
205174
uses: actions/github-script@v7
206-
env:
207-
RAILS_URL: ${{ steps.deploy.outputs.rails_url }}
208175
with:
209176
script: |
210177
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}`;
214181

215182
await github.rest.issues.createComment({
216183
issue_number: context.issue.number || context.payload.pull_request.number,

0 commit comments

Comments
 (0)