matrix-commit-message.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. on: [push]
  2. jobs:
  3. send-message:
  4. runs-on: ubuntu-latest
  5. name: Send message via Matrix
  6. steps:
  7. - name: checkout
  8. uses: actions/checkout@v2
  9. with:
  10. fetch-depth: 0
  11. - run: |
  12. ALL_MSGS=""
  13. for i in ${{ join(github.event.commits.*.id, ' ') }}; do
  14. MSG=$(git --no-pager show -s --format='%h <b>%an</b>: %s' $i)
  15. ALL_MSGS="$ALL_MSGS$MSG<br>"
  16. done
  17. echo "::set-output name=COMMIT_MESSAGE::$ALL_MSGS"
  18. id: commit-message
  19. - uses: narodnik/matrix-action@main
  20. with:
  21. server: 'matrix.dark.fi'
  22. room-id: '!MODZOZydPqCRdulXmR:dark.fi'
  23. #access_token: ${{ secrets.MATRIX_TOKEN }}
  24. status: 'OK'
  25. user: 'b1-66er'
  26. password: ${{ secrets.MATRIX_PASSWORD }}
  27. message: '${{ steps.commit-message.outputs.COMMIT_MESSAGE }}'
  28. #- name: Send message to test channel
  29. # id: matrix-chat-message
  30. # uses: fadenb/matrix-chat-message@v0.0.6
  31. # with:
  32. # homeserver: 'dark.fi'
  33. # token: ${{ secrets.MATRIX_TOKEN }}
  34. # channel: '!MODZOZydPqCRdulXmR:dark.fi'
  35. # message: |
  36. # This is an *example message* using **markdown** for formatting.\
  37. # Use a `\` character at the end of a line to cause a linebreak (the whole message is treated as markdown).\
  38. # You can use variables like ${{ github.sha }} anywhere.