Skip to content

Commit 9ef513a

Browse files
authored
chore: reusable trunk-upgrade (#52)
## what - Replace trunk-upgrade script with the reusable workflow. - Remove @masterpoint-team from reviewers, as it's already in the group. - Fix typon in gitignore. ## why - Less tedious management. ## references - N/A <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Chores - Updated repository code ownership to the open-source maintainers group. - Streamlined the automated upgrade workflow into a single action for improved reliability and reduced maintenance overhead. - Standardized ignore patterns to consistently exclude temporary files across the project. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 3aa7fd9 commit 9ef513a

File tree

3 files changed

+8
-47
lines changed

3 files changed

+8
-47
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Order is important: the last matching pattern takes the most precedence
55

66
# These owners will be the default owners for everything
7-
* @masterpointio/masterpoint-open-source @masterpoint-team
7+
* @masterpointio/masterpoint-open-source

.github/workflows/trunk-upgrade.yaml

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,10 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121

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/[email protected]
2524
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: ${{ secrets.MASTERPOINT_TEAM_PAT }}
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. Auto-approving and merging PR https://github.com/${{ github.repository }}/pull/$PR_NUMBER..."
56-
57-
# Auto-approve the PR
58-
gh pr review "$PR_NUMBER" --approve --body "Auto-approved by trunk upgrade workflow"
59-
60-
# Merge the PR
61-
gh pr merge "$PR_NUMBER" --squash --delete-branch --admin
62-
break
63-
else
64-
echo "Some required checks are still running or pending. Retrying in 30s..."
65-
sleep 30
66-
fi
67-
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"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ backend.tf.json
4040

4141
# Other
4242
**/*.backup
43-
***/*.tmp
43+
**/*.tmp
4444
**/*.temp
4545
**/*.bak
4646
**/*.*swp

0 commit comments

Comments
 (0)