<!-- start pr-codex -->
## PR-Codex overview
This PR introduces a new workflow in the `.github/workflows/linear.yml` file that ensures pull requests contain a linked issue in their body.
### Detailed summary
- Added a new workflow named `Check for linked issue in pull request body`.
- Configured the workflow to trigger on `pull_request` events.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
27 lines
752 B
YAML
27 lines
752 B
YAML
name: Check for linked issue in pull request body
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- edited
|
|
|
|
jobs:
|
|
check_linear_in_pr_body:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check for linked issue in pull request body
|
|
run: |
|
|
pr_body=$(curl -s \
|
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }} | jq -r .body)
|
|
|
|
echo "Pull Request Body: $pr_body"
|
|
|
|
if echo "$pr_body" | grep -iE "CNCT|DASH"; then
|
|
echo "Linked issue found in the pull request body."
|
|
else
|
|
echo "No linked issue found in the pull request body."
|
|
exit 1
|
|
fi
|