The main principle is to use github action to listen for relevant events of the issue, then read the content in the issue, create a file, and submit it to git, and finally deploy it directly. This way, you can edit and display it at any time.
You can refer to the add event to myb log repository for details,
as well as the usage.
Next, let's introduce how to develop a github action:
1. Clone the template provided by the official#
The official mainly supports typescript and provides a series of toolkits. We can only develop with ts,
2. Define the parameters you want the user to input at runtime#
Define the parameters you want to define at runtime by editing the action.yml
file, such as GITHUB_TOKEN
:
The parameters have three attributes:
3. Implement the desired functionality#
For details, you can check my main code. In my code, I mainly did the following:
- Get the content of the current issue based on the current issue number.
- Create file content based on the predefined template.
- Submit to git.
4. Publish to the marketplace#
Check Publish this Action to the GitHub Marketplace, you may need 2fa authentication, find a github support (I use authy, in case I forget later) and you're good to go.
After successfully releasing, you can use it in other projects.