matrix-commit-message.yml 1.4 KB

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