Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/send-emails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,25 @@ jobs:
echo ""

cp /tmp/description.txt "/tmp/tmp_descr.txt"
echo "Commit on github: https://github.com/rust-GCC/gccrs/commit/$SHA1" >> "/tmp/tmp_descr.txt"
echo "Commit on github: https://github.com/${{ github.repository }}/commit/$SHA1" >> /tmp/tmp_descr.txt

if gh api "repos/${{ github.repository }}/commits/$SHA1/pulls" | \
jq '.[].html_url' > /tmp/tmp_pr_links.txt;
then
if [ -n /tmp/tmp_pr_links.txt ]; then
echo "" >> /tmp/tmp_descr.txt
echo "The commit has been mentionned in the following pull-request(s):" >> /tmp/tmp_descr.txt

tr -d '"' < /tmp/tmp_pr_links.txt | \
sed 's/^/ - /' >> /tmp/tmp_descr.txt
else
echo "The commit is not linked to any pull-request" >> /tmp/tmp_descr.txt
fi
else
echo "There was an error fetching data from github API for getting PR for commit" | tee -a $GITHUB_STEP_SUMMARY
fi

echo >> /tmp/tmp_descr.txt

# insert the github header right after the '---'.
sed '/^---$/ r /tmp/tmp_descr.txt' -i "$f"
Expand Down