@@ -19,44 +19,10 @@ jobs:
19
19
- name : Checkout
20
20
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21
21
22
- - name : Create Token for MasterpointBot App
23
- uses : tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
24
- id : generate-token
22
+ - name : Run Trunk Upgrade
23
+ uses : masterpointio/github-action-trunk-upgrade@feat/inital-version
25
24
with :
26
- app_id : ${{ secrets.MP_BOT_APP_ID }}
27
- private_key : ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
28
-
29
- - name : Upgrade
30
- id : trunk-upgrade
31
- uses : trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
32
- with :
33
- github-token : ${{ steps.generate-token.outputs.token }}
34
- reviewers : " @masterpointio/masterpoint-internal"
35
- prefix : " chore: "
36
-
37
- - name : Wait for checks to pass + Merge PR
38
- if : steps.trunk-upgrade.outputs.pull-request-number != ''
39
- env :
40
- GH_TOKEN : ${{ steps.generate-token.outputs.token }}
41
- PR_NUMBER : ${{ steps.trunk-upgrade.outputs.pull-request-number }}
42
- run : |
43
- echo "Waiting for required status checks to pass on PR #$PR_NUMBER..."
44
- while true; do
45
- CHECKS_JSON=$(gh pr checks "$PR_NUMBER" --required --json state,bucket)
46
- echo "Current checks status: $CHECKS_JSON"
47
-
48
- if echo "$CHECKS_JSON" | jq -e '.[] | select(.bucket=="fail")' > /dev/null; then
49
- echo "One or more required checks have failed. Exiting..."
50
- exit 1
51
- fi
52
-
53
- FAILED_OR_PENDING_CHECKS=$(echo "$CHECKS_JSON" | jq '[.[] | select(.state!="SUCCESS" or .bucket!="pass")] | length')
54
- if [ "$FAILED_OR_PENDING_CHECKS" -eq 0 ]; then
55
- echo "All required checks passed. Merging PR https://github.com/${{ github.repository }}/pull/$PR_NUMBER..."
56
- gh pr merge "$PR_NUMBER" --squash --delete-branch --admin
57
- break
58
- else
59
- echo "Some required checks are still running or pending. Retrying in 30s..."
60
- sleep 30
61
- fi
62
- done
25
+ app-id : ${{ secrets.MP_BOT_APP_ID }}
26
+ app-private-key : ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
27
+ github-token : ${{ secrets.MASTERPOINT_TEAM_PAT }}
28
+ reviewers : " @masterpointio/masterpoint-open-source"
0 commit comments