Skip to content

Commit

Permalink
docs: move disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
thollander authored May 7, 2021
1 parent efe5b31 commit 3ef806b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@
A GitHub action that comments with a given message the pull request linked to the pushed branch.
You can even put dynamic data thanks to [Contexts and expression syntax](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions).

## DISCLAIMER

If you prefer not to download a full action, this can now be easily done thanks to [github scripts](https://github.com/actions/github-script).

```yml
- name: 'Comment PR'
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: 'Hello world ! 👋' });
```
## Usage

```
Expand Down Expand Up @@ -54,3 +39,18 @@ It is handled by Typescript compiler.
```sh
$ npm run build
```

## Disclaimer

If you prefer not to download a full action, this can now be easily done thanks to [github scripts](https://github.com/actions/github-script).

```yml
- name: 'Comment PR'
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: 'Hello world ! 👋' });
```

0 comments on commit 3ef806b

Please sign in to comment.