ci: build only the Linux native image per PR #923
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 Check | |
| on: | |
| pull_request_target: | |
| types: [opened, edited, synchronize, reopened] | |
| # Most recent PR change supersedes previous changes. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| # Default to the minimum read-only token for all jobs. | |
| permissions: | |
| contents: read | |
| jobs: | |
| commitlint: | |
| name: PR title / description conforms to semantic-release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| outcome: ${{ steps.commitlint.outcome }} | |
| steps: | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - uses: actions/checkout@v7 | |
| with: | |
| sparse-checkout: | | |
| .commitlintrc.js | |
| sparse-checkout-cone-mode: false | |
| - run: npm install @commitlint/config-conventional | |
| - id: commitlint | |
| continue-on-error: true | |
| run: npx commitlint --verbose <<< $COMMIT_MSG | |
| env: | |
| COMMIT_MSG: > | |
| ${{ github.event.pull_request.title }} | |
| ${{ github.event.pull_request.body }} | |
| comment: | |
| name: Post / remove PR comment | |
| runs-on: ubuntu-latest | |
| needs: commitlint | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| # The message below is prose inside the github-script template literal; | |
| # wrapping it would change the rendered comment, so disable line-length here. | |
| # yamllint disable rule:line-length | |
| - uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| // Hidden marker used to find this job's comment regardless of wording. | |
| const marker = "<!-- pr-title-check -->"; | |
| const message = `${marker} | |
| **ACTION NEEDED** | |
| Substrait follows the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) for release automation. | |
| The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.`; | |
| const passed = "${{ needs.commitlint.outputs.outcome }}" === "success"; | |
| // Find an existing comment from this job, if any. | |
| const comments = await github.paginate(github.rest.issues.listComments, { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const existing = comments.find((c) => c.body.includes(marker)); | |
| if (passed) { | |
| // Clean up the comment now that the check passes. | |
| if (existing) { | |
| await github.rest.issues.deleteComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| }); | |
| } | |
| return; | |
| } | |
| // Check failed: post the comment if it isn't already there, then fail the job. | |
| if (!existing) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: message, | |
| }); | |
| } | |
| core.setFailed( | |
| "PR title and description do not follow the Conventional Commits specification." | |
| ); | |
| # yamllint enable rule:line-length |