Skip to content

Check for linear in PR description #5

Check for linear in PR description

Check for linear in PR description #5

Workflow file for this run

name: Check for "linear" in pull request body
on:
pull_request:
types:
- opened
- edited
jobs:
check_linear_in_pr_body:
runs-on: ubuntu-latest
steps:
- name: Get pull request info
id: pr-info
run: |
# Fetch the pull request body using GitHub's API
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"
echo "::set-output name=body::$pr_body"
- name: Check for "linear" in the pull request body
run: |
if echo "${{ steps.pr-info.outputs.body }}" | grep -iq "linear"; then
echo "'linear' found in the pull request body."
else
echo "'linear' not found in the pull request body."
exit 1
fi