diff --git a/.github/workflows/chore.yml b/.github/workflows/chore.yml index 12d5993..7d4476b 100644 --- a/.github/workflows/chore.yml +++ b/.github/workflows/chore.yml @@ -1,22 +1,25 @@ -name: GitHub PR Chore +name: GitHub PR Size Assessment Trigger on: pull_request: types: - closed jobs: - comment-on-merge: - if: github.event.pull_request.merged == true + assess-pr-size-on-merge: + # if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Comment on the PR uses: actions/github-script@v7 with: script: | + const fs = require('fs'); + const body = fs.readFileSync('instructions.txt', 'utf8'); github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, + issue_number: context.issue.number, owner: context.repo.owner, - repo: context.repo.name, - body: "@coderabbitai assess this PR size with the following criteria and report it in your comment: \n- only include the relevant and main source files and changes in your assessment, for example changes in generated files like lock files should be excluded \n- the assessment should be in the format of: ADDITIONS=number DELETIONS=number \n- no other text and explanation should be in your comment, just the number of addition and deletions that you have assessed \n- you assessment comment should also not include any of your tips or other sections" + repo: context.repo.repo, + body }) diff --git a/README.md b/README.md index 13aa6ef..f2fd11c 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# github-chore \ No newline at end of file +# github-chore + +this repo contains chore github actions for rainlanguage org \ No newline at end of file diff --git a/instructions.txt b/instructions.txt new file mode 100644 index 0000000..d3571be --- /dev/null +++ b/instructions.txt @@ -0,0 +1,9 @@ +@coderabbitai assess this PR size (PR diff) for the totality of the PR with the following criterias and report it in your comment: + +- the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR +- only include the relevant and main source files and changes in your assessment, for example changes in generated files such as lock files should be excluded +- the assessment should be in the format of: ADDITIONS=number DELETIONS=number TOTAL=number , where TOTAL is sum of ADDITIONS and DELETIONS +- the PR size is for the most part the same as the PR diff, but excluding the diff of irrevelant files that were explained earlier +- no other text and explanation should be in your comment, just the number of additions, deletions and total that you have assessed +- you assessment comment should also not include any of your tips or other sections +- do NOT tag me or anyone else on your comment \ No newline at end of file