Skip to content

Commit d339a58

Browse files
committed
Rename variables
1 parent c6a525f commit d339a58

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

action.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,43 @@ runs:
1111
source ${{ github.action_path }}/flag-alt-text.sh
1212
1313
if [ ${{ github.event.comment }} ]; then
14-
comment=$COMMENT
15-
issue=${{ github.event.issue.html_url }}
16-
comment_owner=${{ github.event.comment.user.login }}
14+
content=$COMMENT
15+
issue_url=${{ github.event.issue.html_url }}
16+
user=${{ github.event.comment.user.login }}
1717
if ${{ github.event.issue.pull_request.url != '' }}; then
1818
type=pr_comment
1919
else
2020
type=issue_comment
2121
fi
2222
target=${{ github.event.comment.html_url }}
2323
elif [ ${{ github.event.issue && !github.event.comment }} ]; then
24-
comment=$ISSUE_BODY
25-
issue=${{ github.event.issue.html_url }}
26-
comment_owner=${{ github.event.issue.user.login }}
24+
content=$ISSUE_BODY
25+
issue_url=${{ github.event.issue.html_url }}
26+
user=${{ github.event.issue.user.login }}
2727
type=issue_description
2828
target=" your issue body"
2929
elif [ ${{ github.event.pull_request && !github.event.comment }} ]; then
30-
comment=$PR_BODY
31-
issue=${{ github.event.pull_request.html_url }}
32-
comment_owner=${{ github.event.pull_request.user.login }}
30+
content=$PR_BODY
31+
issue_url=${{ github.event.pull_request.html_url }}
32+
user=${{ github.event.pull_request.user.login }}
3333
type=pr_description
3434
target=" your pull request body"
3535
elif [ ${{ github.event.discussion && !github.event.comment }} ]; then
36-
comment=$DISCUSSION_BODY
36+
content=$DISCUSSION_BODY
3737
discussion_node_id='${{ github.event.discussion.node_id }}'
38-
comment_owner=${{ github.event.discussion.user.login }}
38+
user=${{ github.event.discussion.user.login }}
3939
target='your discussion body'
4040
type=discussion_description
4141
fi
42-
message="Uh oh! @$comment_owner, the image you shared is missing helpful alt text. Check $target.
42+
message="Uh oh! @$user, the image you shared is missing helpful alt text. Check $target.
4343
4444
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
4545
4646
Learn more about alt text at [Basic writing and formatting syntax: images on GitHub Docs](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#images)."
47-
flag="$(flagAltText "$comment")"
47+
flag="$(flagAltText "$content")"
4848
if [[ $flag = true ]]; then
4949
if [[ $type = pr_comment ]] || [[ $type = pr_description ]]; then
50-
gh pr comment $issue --body "$message"
50+
gh pr comment $issue_url --body "$message"
5151
elif [[ $type = discussion_description ]]; then
5252
gh api graphql -F discussionId="$discussion_node_id" -F body="$message" -f query='
5353
mutation($discussionId: ID!, $body: String!) {
@@ -59,7 +59,7 @@ runs:
5959
}
6060
'
6161
else
62-
gh issue comment $issue --body "$message"
62+
gh issue comment $issue_url --body "$message"
6363
fi
6464
fi
6565
shell: bash

0 commit comments

Comments
 (0)