Skip to content

Commit

Permalink
chore(CI): Add new comment to smithy diff checker gha (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
rishav-karanjit authored and lucasmcdonald3 committed Aug 29, 2024
1 parent 81a4f31 commit fa89f82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/smithy-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
id: file-changes
shell: bash
run:
# Checks to see if any of the customer facing Models are being updated.
# Doing this check allows us to catch things like, missing @javadoc trait documentation.
echo "FILES=$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} AwsCryptographicMaterialProviders/dafny/**/Model/*.smithy | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
# Checks to see if any of the smithy Models are being updated.
# Doing this check allows us to catch things like, missing @javadoc trait documentation or bug in smithy dafny that has not be resolved.
echo "FILES=$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} | grep '\.smithy$' | tr '\n' ' ')" >> "$GITHUB_OUTPUT"

- name: Check if FILES is not empty
id: comment
Expand All @@ -32,6 +32,7 @@ jobs:
FILES: ${{ steps.file-changes.outputs.FILES }}
if: ${{env.FILES != ''}}
run: |
COMMENT="@${{github.actor}}, I noticed you are updating the smithy model files.\nDoes this update need new or updated javadoc trait documentation?"
# TODO: If https://github.com/smithy-lang/smithy-dafny/issues/491 is resolved, remove comment about this issue.
COMMENT="@${{github.actor}}, I noticed you are updating the smithy model files.\nDoes this update need new or updated javadoc trait documentation?\n Are you adding constraints inside list, map or union? Do you know about this issue: https://github.com/smithy-lang/smithy-dafny/issues/491?"
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"

0 comments on commit fa89f82

Please sign in to comment.