Skip to content

Commit

Permalink
capture github diff in gpml file
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushi-agrawal-gladstone authored Sep 19, 2024
1 parent b928a1f commit 37ed7bf
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/1_on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ jobs:
GPML_FILE: ${{ needs.get-gpml.outputs.gpml-file }}
GPML_NAME: ${{ needs.get-gpml.outputs.gpml-name }}
GPML_DESC: ${{ needs.get-gpml.outputs.gpml-desc }}
STATUS: ${{ needs.get-gpml.outputs.status }}
steps:
- name: Checkout repository for scripts
uses: actions/checkout@v4
Expand All @@ -779,11 +780,25 @@ jobs:
# Downloads gpml-file and metadata artifacts to working dir
# Note: Automatically unzips as folders containing files with original filenames
uses: actions/download-artifact@v4

- name: Install tools
run: sudo apt-get install -y jq

- name: Fetch PR Diff
id: fetch_diff
run: |
PR_NUMBER="${{ needs.get-pr.outputs.pr-number }}"
GPML_FILE="${{ needs.get-gpml.outputs.gpml-file }}"
# Fetch the diff for the GPML file in the current PR
diff_output=$(gh pr diff "$PR_NUMBER" -- "$GPML_FILE")
echo "$diff_output"
echo "diff_output=$diff_output" >> $GITHUB_ENV
- name: Perform Test 1 (characters in title)
run: |
title=$GPML_NAME
echo "The length of the string is ${#title}"
echo "The length of the title is ${#title}"
title_length=${#title}
if [ "$title_length" -ge 10 ]; then
Expand All @@ -797,6 +812,21 @@ jobs:
echo "status_test1=FAIL" >> $GITHUB_ENV
echo "color_test1=red" >> $GITHUB_ENV
fi
- name: Perform Test 2 (characters in title)
run: |
desc=$GPML_DESC
status=$STATUS
echo "The length of the description is ${#desc}"
echo " This is a $status pathway"
desc_length=${#desc}
if [ "$desc_length" -ge 15 & "$status" = "New" ]; then
echo "Description has at least 15 characters."
echo "note_test2=Description has at least 15 characters." >> $GITHUB_ENV
echo "status_test2=PASS" >> $GITHUB_ENV
echo "color_test2=green" >> $GITHUB_ENV
fi
- name: Report on testing
Expand Down

0 comments on commit 37ed7bf

Please sign in to comment.