File tree Expand file tree Collapse file tree 2 files changed +2
-32
lines changed
actions/delete-control-plane-app Expand file tree Collapse file tree 2 files changed +2
-32
lines changed Original file line number Diff line number Diff line change 2828
2929# Delete the application
3030echo " 🗑️ 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
3434fi
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments