diff --git a/README.md b/README.md index 6c1c8c4f..cfb4695b 100644 --- a/README.md +++ b/README.md @@ -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/github-script@0.3.0 - 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 ``` @@ -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/github-script@0.3.0 + 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 ! 👋' }); +```