fix(library): make embedded editors reliable in host applications #318
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
| name: PR title | |
| # The PR title becomes the squash-merge commit subject, so it must pass the | |
| # same commitlint rules as a commit message. Runs on pull_request_target so it | |
| # can post a sticky comment on fork PRs; it never checks out PR-head code and | |
| # reads the title only through an env var (never interpolated into a shell). | |
| on: | |
| pull_request_target: | |
| types: [opened, edited, reopened, ready_for_review] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: pr-title-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| name: Validate title | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| if: ${{ !github.event.pull_request.draft }} | |
| steps: | |
| # Default ref is the base branch (trusted), not PR head. | |
| # commitlint.config.mjs is the single source of truth for types + scopes. | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@ac6db6d3c1f721f886538a378a2d73e85697340a # v6.0.8 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - id: commitlint | |
| continue-on-error: true | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: printf '%s' "$PR_TITLE" | pnpm exec commitlint | |
| - uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4 | |
| if: steps.commitlint.outcome == 'failure' | |
| with: | |
| header: pr-title-lint-error | |
| message: | | |
| ## ❌ PR title is not a valid Conventional Commit | |
| Expected `<type>(<scope>)?: <subject>`. The commitlint output in the failed check names the rule that broke. The allowed `type` and `scope` sets are defined in [`commitlint.config.mjs`](https://github.com/ls1intum/Apollon/blob/main/commitlint.config.mjs) (the single source of truth); see also [`CONTRIBUTING.md`](https://github.com/ls1intum/Apollon/blob/main/CONTRIBUTING.md). | |
| - uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4 | |
| if: steps.commitlint.outcome == 'success' | |
| with: | |
| header: pr-title-lint-error | |
| delete: true | |
| - if: steps.commitlint.outcome == 'failure' | |
| run: exit 1 |