From 3ef806b0792ed581bd16b3e73d424fbec9bd5a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9rence=20Hollander?= Date: Fri, 7 May 2021 22:12:01 +0200 Subject: [PATCH] docs: move disclaimer --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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 ! 👋' }); +```