action-mercure

By Ilshidur

Back

action-mercure

πŸš€ GitHub Action for Mercure

https://github.com/Ilshidur/action-mercure

πŸš€ GitHub Action for Mercure

Send a Mercure publish event. Simple as that.

GitHub Action


Demo

  1. Go to https://demo.mercure.rocks, in the Subscribe section.
  2. Subscribe for notifications on this topic : foo.
  3. 🌟 Star 🌟 this repo !
  4. Quickly switch to the Mercure demo page to see a notification in your browser.

Usage

action "Publish notification" {
  uses = "Ilshidur/action-mercure@master"
  secrets = ["MERCURE_HUB_URL", "MERCURE_HUB_JWT"]
  args = "{ \"hello\": \"world\" }"
}

NOTICE : for stability purposes, it is recommended to use the action with an explicit commit SHA-1 :

uses = "Ilshidur/action-mercure@eea8db9" (=> link to the commits list : https://github.com/Ilshidur/action-mercure/commits/master)

Arguments

The argument is the content of the event to send. It is RECOMMENDED to use JSON.

Environment variables can be interpolated in the message using brackets ({{ and }}) :

e.g.: args = "{ \"action\": \"{{ GITHUB_ACTION }}\" }"

Environment variables

  • MERCURE_TOPICS: the Mercure topics. Supports interpolation using ({{ and }}).

Secrets

  • MERCURE_HUB_URL: the public Mercure hub URL (required).
  • MERCURE_HUB_JWT: the publisher JWT (required).
  • That's all.

License

GNU GENERAL PUBLIC LICENSE v3.


Don't forget to 🌟 Star 🌟 the repo if you like this GitHub Action !
Your feedback is appreciated