Repository navigation
feat(threads): first-class standing bot threads #38
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: Closura deploy line | |
| # Every pull request into the native release branch says whether it changes | |
| # what runs, so "merged" is never mistaken for "live". The value is opaque on | |
| # purpose: "fleet" means the private deployment config decides where it runs, | |
| # and no host names are published here. This job reads only the event payload: | |
| # no checkout, no token and no repository code, so it runs on a hosted runner | |
| # and needs no actor guard. | |
| on: | |
| pull_request: | |
| branches: [release/native-0.1.10] | |
| types: [opened, reopened, synchronize, edited, ready_for_review] | |
| permissions: {} | |
| concurrency: | |
| group: closura-deploy-line-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy-line: | |
| if: ${{ github.repository == 'nullStack65/t3code' }} | |
| name: Deploy line declared | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: 'Require one Deploy line: none or fleet' | |
| shell: bash | |
| env: | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| set -euo pipefail | |
| # Count "Deploy:" lines at the start of a line, outside fenced code blocks. | |
| lines="$(printf '%s\n' "${PR_BODY:-}" | tr -d '\r' \ | |
| | awk '/^[[:space:]]*(```|~~~)/ { fenced = !fenced; next } !fenced && /^Deploy:/' || true)" | |
| count="$(printf '%s' "$lines" | grep -c . || true)" | |
| if test "$count" -ne 1; then | |
| echo "::error::Add exactly one line 'Deploy: none' or 'Deploy: fleet' to the PR body (found $count)." | |
| exit 1 | |
| fi | |
| value="$(printf '%s' "$lines" | sed -E 's/^Deploy:[[:space:]]*//; s/[[:space:]]+$//')" | |
| case "$value" in | |
| none | fleet) echo "Deploy: $value" ;; | |
| *) | |
| echo "::error::The Deploy line must be 'Deploy: none' or 'Deploy: fleet'." | |
| exit 1 | |
| ;; | |
| esac |