matrix-commit-message.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. - run: |
  10. ALL_MSGS=""
  11. for i in ${{ join(github.event.commits.*.id, ' ') }}; do
  12. MSG=$(git --no-pager show -s --format='%h %an: %s' $i)
  13. ALL_MSGS="$ALL_MSGS$MSG"$'\n'
  14. done
  15. echo "::set-output name=COMMIT_MESSAGE::$ALL_MSGS"
  16. id: commit-message
  17. - uses: narodnik/matrix-action@main
  18. with:
  19. server: 'matrix.dark.fi'
  20. room-id: '!MODZOZydPqCRdulXmR:dark.fi'
  21. #access_token: ${{ secrets.MATRIX_TOKEN }}
  22. status: 'OK'
  23. user: 'narodnik'
  24. password: ${{ secrets.MATRIX_PASSWORD }}
  25. message: ${{ steps.commit-message.outputs.COMMIT_MESSAGE }}
  26. #- name: Send message to test channel
  27. # id: matrix-chat-message
  28. # uses: fadenb/matrix-chat-message@v0.0.6
  29. # with:
  30. # homeserver: 'dark.fi'
  31. # token: ${{ secrets.MATRIX_TOKEN }}
  32. # channel: '!MODZOZydPqCRdulXmR:dark.fi'
  33. # message: |
  34. # This is an *example message* using **markdown** for formatting.\
  35. # Use a `\` character at the end of a line to cause a linebreak (the whole message is treated as markdown).\
  36. # You can use variables like ${{ github.sha }} anywhere.