JJ / github-pr-contains-action

Action that checks whether the body or diff in a PR contains a certain word.
MIT License
35 stars 34 forks source link

The FILES output does not seem to contain the file names #125

Closed JJ closed 7 months ago

JJ commented 7 months ago

This is what it contains:

We got files: [{"chunks":[{"content":"@@ -18,12 +18,19 @@
jobs:","changes":[{"type":"normal","normal":true,"ln1":18,"ln2":18,"content":"
bodyContains:
\"[x]\""},{"type":"normal","normal":true,"ln1":19,"ln2":19,"content":"
bodyDoesNotContain:
\"your|own\""},{"type":"normal","normal":true,"ln1":20,"ln2":20,"content":"
diffDoesNotContain: \"TODO\""},{"type":"del","del":true,"ln":21,"content":"-
linesChanged: 1"},{"type":"del","del":true,"ln":22,"content":"-
waivedUsers:
\"dependabot[bot]|JJ\""},{"type":"normal","normal":true,"ln1":23,"ln2":21,"content":"       -
name: Info PR"},{"type":"del","del":true,"ln":24,"content":"-
with:"},{"type":"add","add":true,"ln":22,"content":"+
env:"},{"type":"normal","normal":true,"ln1":25,"ln2":23,"content":"
FILES : ${{ steps.dev_check_pr.outputs.files
}}"},{"type":"normal","normal":true,"ln1":26,"ln2":24,"content":"
DIFF : ${{ steps.dev_check_pr.outputs.diff
}}"},{"type":"normal","normal":true,"ln1":27,"ln2":25,"content":"         run:
|"},{"type":"del","del":true,"ln":28,"content":"-          echo \"We got files: $( echo -n $FILES | wc -l )\""},{"type":"add","add":true,"ln":26,"content":"+          echo \"::warning::We got files: $FILES\""},{"type":"add","add":true,"ln":27,"content":"+          echo \"::warning::We got diff: $DIFF\""},{"type":"add","add":true,"ln":28,"content":"+          NUMBER_OF_FILES=$($FILES | wc -l)"},{"type":"add","add":true,"ln":29,"content":"+          echo \"NUMBER_OF_FILES=$NUMBER_OF_FILES\" >> $GITHUB_ENV"},{"type":"add","add":true,"ln":30,"content":"+          echo \"We got files: $NUMBER_OF_FILES\""},{"type":"normal","normal":true,"ln1":29,"ln2":31,"content":"           echo \"We got diff: $( echo -n $DIFF | wc -l ) lines in diff\""},{"type":"add","add":true,"ln":32,"content":"+      - name: Fail if too big"},{"type":"add","add":true,"ln":33,"content":"+        if: ${{ env.NUMBER_OF_FILES > 3 }}"},{"type":"add","add":true,"ln":34,"content":"+        run: |"},{"type":"add","add":true,"ln":35,"content":"+          echo \"::error::Too many files, there are $NUMBER_OF_FILES\""},{"type":"add","add":true,"ln":36,"content":"+          exit 1"}],"oldStart":18,"oldLines":12,"newStart":18,"newLines":19}],"deletions":4,"additions":11,"from":".github/workflows/local-testing.yaml","to":".github/workflows/local-testing.yaml","index":["1e1e7fdf..2493166c","100644"]},{"chunks":[],"deletions":0,"additions":0,"from":"/dev/null","to":"kk","new":true,"index":["00000000..e69de29b"]},{"chunks":[],"deletions":0,"additions":0,"from":"/dev/null","to":"kk2","new":true,"index":["00000000..e69de29b"]},{"chunks":[],"deletions":0,"additions":0,"from":"/dev/null","to":"kk3","new":true,"index":["00000000..e69de29b"]}]