fix: Remove tests and examples for deprecated models #1385
Workflow file for this run
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
| # This workflow uses pull_request_target, which grants write access to | |
| # the repo even for PRs from forks. This is safe ONLY because the checkout | |
| # fetches the base branch (main), not the PR head. Do NOT add: | |
| # - actions/checkout with ref: ${{ github.event.pull_request.head.sha }} | |
| # - run: steps that execute scripts from the PR branch | |
| # - any step that sources or evals PR-controlled content | |
| # Doing so would let a malicious fork run arbitrary code with write permissions. | |
| name: PR Bot | |
| on: | |
| pull_request_target: # zizmor: ignore[dangerous-triggers] | |
| types: [opened, edited] | |
| jobs: | |
| update-pr-body: | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.body, 'mellea-pr-edited-marker') }} | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| steps: | |
| - name: Checkout code # Checks out the base branch, not PR branch. | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Detect PR type from checkboxes | |
| id: detect-type | |
| env: | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| PR_TYPE="" | |
| # Check for checked boxes (supports [x] and [X]) | |
| if echo "$PR_BODY" | grep -qi '\[x\] Component'; then | |
| PR_TYPE="component" | |
| elif echo "$PR_BODY" | grep -qi '\[x\] Requirement'; then | |
| PR_TYPE="requirement" | |
| elif echo "$PR_BODY" | grep -qi '\[x\] Sampling Strategy'; then | |
| PR_TYPE="sampling" | |
| elif echo "$PR_BODY" | grep -qi '\[x\] Tool'; then | |
| PR_TYPE="tool" | |
| elif echo "$PR_BODY" | grep -qi '\[x\] Misc'; then | |
| PR_TYPE="misc" | |
| fi | |
| if [ -z "$PR_TYPE" ]; then | |
| echo "::error::No PR type selected. Please check one of of the boxes from the original pr template." | |
| exit 1 | |
| fi | |
| echo "pr_type=$PR_TYPE" >> "$GITHUB_OUTPUT" | |
| echo "Detected PR type: $PR_TYPE" | |
| - name: Update PR body with checklist | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| PR_TYPE: ${{ steps.detect-type.outputs.pr_type }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| TEMPLATE_FILE=".github/PULL_REQUEST_TEMPLATE/${PR_TYPE}.md" | |
| if [ -f "$TEMPLATE_FILE" ]; then | |
| MARKER="<!-- mellea-pr-edited-marker: do not remove this marker -->" | |
| TEMPLATE_CONTENT=$(cat "$TEMPLATE_FILE") | |
| NEW_BODY="${MARKER} | |
| ${TEMPLATE_CONTENT}" | |
| gh pr edit "$PR_NUMBER" --body "$NEW_BODY" | |
| echo "Updated PR body with ${PR_TYPE} checklist" | |
| else | |
| echo "::error::Template file not found: $TEMPLATE_FILE" | |
| echo "Something as gone wrong. Contact a maintainer." | |
| exit 1 | |
| fi | |
| - name: Comment on PR | |
| uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc | |
| with: | |
| message: | | |
| The PR description has been updated. Please fill out the template for your PR to be reviewed. |