Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Nov 14, 2023
1 parent 3860d7e commit 9ea29e7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 48 deletions.
14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE/try-it.yml

This file was deleted.

17 changes: 6 additions & 11 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
name: Test action
name: Try me
on:
issues:
pull_request:
types: labeled
jobs:
test-action:
if: github.event.label.name == 'lorem ipsum'
if: github.event.label.name == 'try me'
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- run: gh issue comment "$NUMBER" --body "$BODY"
- run: gh pr close "$NUMBER" --comment "$COMMENT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
BODY: >
COMMENT: >
Lorem ipsum is placeholder text commonly used in the graphic, print,
and publishing industries for previewing layouts and visual mockups.
- run: gh issue close "$NUMBER" --repo "$REPO"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
33 changes: 13 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Create GitHub Issue comment
# Create name: Close GitHub Pull Request

💬 Create a new comment on a GitHub Issue
❌ Close a GitHub Pull Request as unmerged

<p align=center>
<img src="https://i.imgur.com/ZFJpji1.png">
</p>

👨‍💻 Use the [GitHub CLI](https://cli.github.com/) \
👨‍💻 Use the [GitHub CLI] \
😱 You don't even need a GitHub Action to do it!

## Usage
Expand All @@ -22,43 +22,36 @@ jobs:
lorem-ipsum-comment:
if: github.event.label.name == 'lorem ipsum'
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- run: gh issue comment "$NUMBER" --body "$BODY"
- run: gh pr close "$NUMBER" --comment "$COMMENT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
BODY: >
COMMENT: >
Lorem ipsum is placeholder text commonly used in the graphic, print,
and publishing industries for previewing layouts and visual mockups.
```
[➕ Create a new Issue and try it out!](https://github.com/actions4gh/create-issue-comment/issues/new?assignees=&labels=lorem+ipsum&projects=&template=try-it.yml&title=Try+it%21)
💡 The GitHub CLI is always provided on all GitHub runners. To install it on
custom runners check out [actions4gh/setup-github-cli].
custom runners check out [actions4gh/setup-gh].
```sh
gh issue comment {<number> | <url>} [flags]
gh pr close {<number> | <url> | <branch>} [flags]
```

**`gh issue comment` options:** <sup>(excerpt)</sup>

- **`-b``--body <text>`:** The comment body text

- **`-F``--body-file <file>`:** Read body text from file (use "-" to read from
standard input)
- **`-c``--comment <string>`:** Leave a closing comment

- **`--edit-last`:** Edit the last comment of the same author
- **`-d``--delete-branch`:** Delete the local and remote branch after close

- **`-R``--repo <[HOST/]OWNER/REPO>`:** Select another repository using the
`[HOST/]OWNER/REPO` format

[📚 gh issue comment | GitHub CLI](https://cli.github.com/manual/gh_issue_comment)
[📚 gh pr close | GitHub CLI](https://cli.github.com/manual/gh_pr_close)

<!-- prettier-ignore-start -->
[actions4gh/update-issue-comment]: https://github.com/actions4gh/update-issue-comment#readme
[actions4gh/setup-github-cli]: https://github.com/actions4gh/setup-github-cli#readme
<!-- prettier-ignore-end -->
[github cli]: https://cli.github.com/
[actions4gh/setup-gh]: https://github.com/actions4gh/setup-gh
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Create GitHub Issue comment
description: 💬 Create a new comment on a GitHub Issue
name: Close GitHub Pull Request
description: ❌ Close a GitHub Pull Request as unmerged

branding:
icon: message-square
icon: x
color: blue

0 comments on commit 9ea29e7

Please sign in to comment.