Skip to content

Commit

Permalink
Update auto-comment.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fineanmol committed Sep 15, 2024
1 parent ad587ad commit a092ee2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/auto-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Check if it's an issue or pull request
id: determine_event
- name: Determine event type and set variables
run: |
if [[ "${{ github.event_name }}" == 'issues' ]]; then
echo "COMMENT_BODY=@${{ github.event.issue.user.login }} Please Star ⭐️ the repo to earn '**_hacktober-accepted_**' label for the event.\nMeanwhile, if you want to work on this issue, please raise a PR, and we will review and merge it." >> $GITHUB_ENV
Expand All @@ -29,18 +28,19 @@ jobs:
fi
shell: bash

- name: Authenticate GitHub CLI
run: echo "${{ secrets.AUTOMERGE_TOKEN }}" | gh auth login --with-token
env:
GITHUB_TOKEN: ${{ secrets.AUTOMERGE_TOKEN }}
- name: Unset GITHUB_TOKEN and authenticate GitHub CLI
run: |
unset GITHUB_TOKEN
echo "${{ secrets.AUTOMERGE_TOKEN }}" | gh auth login --with-token
shell: bash

- name: Comment on issue/PR
if: env.GH_COMMAND != ''
run: |
echo "Commenting on $GH_COMMAND #$ITEM_NUMBER..."
echo -e "$COMMENT_BODY" | gh $GH_COMMAND comment $ITEM_NUMBER --body -
gh $GH_COMMAND comment $ITEM_NUMBER --body "$COMMENT_BODY"
env:
COMMENT_BODY: ${{ env.COMMENT_BODY }}
ITEM_NUMBER: ${{ env.ITEM_NUMBER }}
GH_COMMAND: ${{ env.GH_COMMAND }}
shell: bash
if: env.GH_COMMAND != ''

0 comments on commit a092ee2

Please sign in to comment.