[Java] Spring Boot: Enable JSON TLS #1974
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Commands | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: write | |
| jobs: | |
| runner-busy: | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/benchmark') && vars.RUNNER_LOCAL == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Post runner-busy notice | |
| run: | | |
| gh api "/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions" -f content="eyes" | |
| gh pr comment "${{ github.event.issue.number }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --body "⏸️ Runner is currently performing local benchmark runs and is disabled for GitHub Actions, please try later or check our Discord announcements on runner state for more info." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # ── /benchmark — requires collaborator approval ── | |
| acknowledge-benchmark: | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/benchmark') && vars.RUNNER_LOCAL != 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Acknowledge command | |
| run: | | |
| gh api "/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions" -f content="eyes" | |
| gh pr comment "${{ github.event.issue.number }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --body "👋 \`/benchmark\` request received. A collaborator will review and approve the run." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| handle-benchmark: | |
| needs: acknowledge-benchmark | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/benchmark') && vars.RUNNER_LOCAL != 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: refs/pull/${{ github.event.issue.number }}/head | |
| fetch-depth: 0 | |
| - name: Parse command | |
| id: parse | |
| run: | | |
| PR="$PR_NUMBER" | |
| echo "pr=$PR" >> "$GITHUB_OUTPUT" | |
| AUTO_FRAMEWORK=$(gh api "/repos/$REPO/pulls/$PR/files" --paginate --jq '.[].filename' | grep '^frameworks/' | cut -d'/' -f2 | sort -u | head -1) | |
| # Parse flags: -f <framework> -t <test> | |
| EXPLICIT_FW=$(echo "$COMMENT_BODY" | grep -oP '/benchmark\s+.*-f\s+\K\S+' || echo "") | |
| EXPLICIT_TEST=$(echo "$COMMENT_BODY" | grep -oP '/benchmark\s+.*-t\s+\K\S+' || echo "") | |
| # Fallback: positional arg (legacy: /benchmark baseline) | |
| if [ -z "$EXPLICIT_FW" ] && [ -z "$EXPLICIT_TEST" ]; then | |
| EXPLICIT_TEST=$(echo "$COMMENT_BODY" | grep -oP '/benchmark\s+\K[^-]\S*' || echo "") | |
| fi | |
| # Parse --save flag | |
| SAVE_FLAG="" | |
| if echo "$COMMENT_BODY" | grep -q '\-\-save'; then | |
| SAVE_FLAG="true" | |
| fi | |
| FRAMEWORK="${EXPLICIT_FW:-$AUTO_FRAMEWORK}" | |
| echo "framework=$FRAMEWORK" >> "$GITHUB_OUTPUT" | |
| echo "profile=$EXPLICIT_TEST" >> "$GITHUB_OUTPUT" | |
| echo "save=$SAVE_FLAG" >> "$GITHUB_OUTPUT" | |
| echo "Detected framework: $FRAMEWORK (auto: $AUTO_FRAMEWORK, explicit: $EXPLICIT_FW)" | |
| echo "Profile: $EXPLICIT_TEST, Save: $SAVE_FLAG" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COMMENT_BODY: ${{ github.event.comment.body }} | |
| PR_NUMBER: ${{ github.event.issue.number }} | |
| REPO: ${{ github.repository }} | |
| # Pre-check that origin/main can auto-merge into the PR. The actual | |
| # merge happens inside benchmark-pr.yml after maintainer approval; | |
| # doing the dry-run here lets us reject conflicting PRs before | |
| # asking a maintainer to approve a run that's guaranteed to abort. | |
| # Skipped for non-save runs since they don't push back. | |
| - name: Check main merges into PR | |
| if: steps.parse.outputs.save == 'true' && steps.parse.outputs.framework != '' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git fetch origin main --depth=1 | |
| if ! git merge --no-commit --no-ff origin/main; then | |
| git merge --abort 2>/dev/null || true | |
| gh pr comment "${{ steps.parse.outputs.pr }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --body "⚠️ \`/benchmark --save\` cannot start: \`main\` has diverged and cannot be auto-merged into this branch. Please merge or rebase \`main\` manually, push, and re-run \`/benchmark --save\`." | |
| exit 1 | |
| fi | |
| # Discard the merged state — actual merge runs in benchmark-pr.yml | |
| # after maintainer approval. main may move between now and then. | |
| git merge --abort 2>/dev/null || true | |
| - name: React to comment | |
| run: | | |
| gh api "/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions" -f content="rocket" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run benchmark | |
| if: steps.parse.outputs.framework != '' | |
| run: | | |
| gh workflow run benchmark-pr.yml \ | |
| -f pr=${{ steps.parse.outputs.pr }} \ | |
| -f framework=${{ steps.parse.outputs.framework }} \ | |
| -f profile="${{ steps.parse.outputs.profile }}" \ | |
| -f save="${{ steps.parse.outputs.save }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: No framework detected | |
| if: steps.parse.outputs.framework == '' | |
| run: | | |
| gh pr comment "${{ steps.parse.outputs.pr }}" --body "⚠️ Couldn't detect which framework to test. Either modify files under \`frameworks/<name>/\` or specify explicitly: \`/benchmark -f <framework> -t <test>\`" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |