support to fliter issues and tickets based on child parts #54
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: validate description | |
on: | |
# pull_request_target is meant to run on bot commits. | |
# Do check out and run code from the pull request's head commit. | |
# It is suitable for this usecase as we are only looking at PR description. | |
pull_request_target: | |
types: [opened, synchronize, reopened, edited] | |
jobs: | |
validate_description: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out workflow tooling repository | |
uses: actions/checkout@v4 | |
with: | |
repository: devrev/global-gh-tools | |
path: .global-checks-tooling | |
- name: Fetch latest PR description using GitHub REST API | |
id: fetch_pr | |
run: | | |
sudo apt-get install jq | |
echo "Fetching latest PR description using REST API" | |
pr_number="${{ github.event.pull_request.number }}" | |
repo="${{ github.repository }}" | |
api_url="https://api.github.com/repos/$repo/pulls/$pr_number" | |
pr_body=$(curl -sSL \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
"$api_url" | jq -r '.body') | |
echo "$pr_body" > pr_body.txt | |
- name: Check PR description for work item link | |
run: | | |
echo "Checking PR description for work item link" | |
python .global-checks-tooling/checks/check_pr_description.py "$(cat pr_body.txt)" |