diff --git a/.github/workflows/L1-tests.yml b/.github/workflows/L1-tests.yml index 5379edf..66d8453 100644 --- a/.github/workflows/L1-tests.yml +++ b/.github/workflows/L1-tests.yml @@ -1,3 +1,4 @@ + name: l1-tests on: @@ -127,3 +128,4 @@ jobs: with: name: coverage-report path: /tmp/coverage_report + diff --git a/.github/workflows/PRComment.yml b/.github/workflows/PRComment.yml new file mode 100644 index 0000000..0516859 --- /dev/null +++ b/.github/workflows/PRComment.yml @@ -0,0 +1,33 @@ +name: PR Comment + +on: + pull_request: + types: [opened, synchronize] + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Checkout PR + uses: actions/checkout@v3 + + - name: Run git fetch + id: lines_added + run : | + cd ${{ github.workspace }} + git fetch origin ${{ github.event.pull_request.base.ref }} + git fetch origin ${{ github.event.pull_request.head.ref }} + ADDED_LINES=$(git diff --unified=0 origin/${{ github.event.pull_request.base.ref }} origin/${{ github.event.pull_request.head.ref }} | grep '^+' | grep -v '^+++' | wc -l) + echo "added_lines=${ADDED_LINES}" >> $GITHUB_OUTPUT + echo "check : added_lines $ADDED_LINES" + + - name: Post a comment on the PR + uses: peter-evans/create-or-update-comment@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body : | + Newly added lines compared to develop: ${{ steps.lines_added.outputs.added_lines }} + 👋 Hello! This is an automated comment from GitHub Actions. + Let me know if you need help with anything! +