Skip to content

Commit 8487edc

Browse files
committed
fixes
1 parent 3d45555 commit 8487edc

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

.github/actions/delete-control-plane-app/delete-app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fi
2828

2929
# Delete the application
3030
echo "🗑️ Deleting application: $APP_NAME"
31-
if ! cpflow delete -a "$APP_NAME" --org "$CPLN_ORG" --force; then
31+
if ! cpflow delete -a "$APP_NAME" --org "$CPLN_ORG"; then
3232
echo "❌ Failed to delete application: $APP_NAME" >&2
3333
exit 1
3434
fi

.github/workflows/nightly-remove-stale-review-apps.yml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,5 @@ jobs:
2020
token: ${{ secrets.CPLN_TOKEN_STAGING }}
2121
org: ${{ vars.CPLN_ORG_STAGING }}
2222

23-
- name: Get Stale PRs
24-
id: stale_prs
25-
uses: actions/github-script@v7
26-
with:
27-
script: |
28-
const thirtyDaysAgo = new Date();
29-
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
30-
31-
const prs = await github.rest.pulls.list({
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
34-
state: 'closed',
35-
sort: 'updated',
36-
direction: 'desc'
37-
});
38-
39-
const stalePRs = prs.data
40-
.filter(pr => new Date(pr.updated_at) < thirtyDaysAgo)
41-
.map(pr => pr.number);
42-
43-
console.log('Found stale PRs:', stalePRs);
44-
return stalePRs;
45-
4623
- name: Delete Stale Review Apps
47-
if: ${{ steps.stale_prs.outputs.result != '[]' }}
48-
run: |
49-
for pr in $(echo "${{ steps.stale_prs.outputs.result }}" | jq -r '.[]'); do
50-
APP_NAME="qa-react-webpack-rails-tutorial-pr-$pr"
51-
CPLN_ORG=${{ vars.CPLN_ORG_STAGING }}
52-
echo "🗑️ Deleting stale review app for PR #$pr: $APP_NAME"
53-
APP_NAME=$APP_NAME CPLN_ORG=$CPLN_ORG ${{ github.workspace }}/.github/actions/delete-control-plane-app/delete-app.sh
54-
done
24+
run: cpflow cleanup-stale-apps --yes

0 commit comments

Comments
 (0)