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