-
Notifications
You must be signed in to change notification settings - Fork 15
Add support for validating discussion description #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
elif [[ $is_discussion = true ]]; then | ||
gh api graphql -F discussionId="$discussion_node_id" -F body="$message" -f query=' | ||
mutation($discussionId: ID!, $body: String!) { | ||
addDiscussionComment(input: {discussionId: $discussionId, body: $body}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replyToId
(The Node ID of the discussion comment within this discussion to reply to.) might be useful when we add discussion comments
Doing some minor refactors for readability! Please hold! |
action.yml
Outdated
target=" your pull request body" | ||
elif [ ${{ github.event.discussion && !github.event.comment }} ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only thought is since this is the only option using graphql what if we just moved the graphql command into this if statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will want to make this call based on the result of flag="$(flagAltText "$content")"
which happens later! So I think we should keep the graphql command where it is!
I did some additional refactors which may help with readability.
comment_owner=${{ github.event.pull_request.user.login }} | ||
is_pr=true | ||
target=" your pull request body" | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can assume that else
will be anything that's not a comment event, instead of having the check in every elif
:
elif [ ${{ github.event.issue && !github.event.comment }} ];
issue=${{ github.event.issue.html_url }} | ||
comment_owner=${{ github.event.comment.user.login }} | ||
is_pr=${{ github.event.issue.pull_request.url != '' }} | ||
content=$COMMENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed comment
to content
and comment_owner
to user
, since comment
might be confusing given it's association with github.event.comment
. We're setting these variables for non-comment events too.
comment=$COMMENT | ||
issue=${{ github.event.issue.html_url }} | ||
comment_owner=${{ github.event.comment.user.login }} | ||
is_pr=${{ github.event.issue.pull_request.url != '' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this is_pr
variable to be type
, and set to one of:
issue_description
issue_comment
pr_description
pr_comment
discussion_description
I think this will make what we're dealing with more clear.
👋 Hello and thanks for pinging us! You've entered our first responder queue. An accessibility first responder will review this soon.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this is merged I can update the repo description!
@khiga8 We may want to update the readme description too:
|
@@ -1,6 +1,6 @@ | |||
# Accessibility-alt-text-bot | |||
|
|||
This action supports accessible content sharing on GitHub by leaving an automated reminder whenever an image is shared on a GitHub Issue or Pull request without meaningful alternative text (alt text). | |||
This action supports accessible content sharing on GitHub by leaving an automated reminder whenever an image is shared on a GitHub Issue, Pull request, or Discussion without meaningful alternative text (alt text). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Part of: #11