We use GitHub Actions workflow for updating Redmine's issue resource with GitHub pull_request command, this action update targeted Redmine issue by adding notes with the first comment added to the GitHub pull request.
It is required to add in the PR comment the Redmine explicit http link.
Example: https://redmine.company.com/issues/id_of_issue
You can also add PERCENTAGE_DONE=percentage (10, 20, 30...)
This will trigger the update of the percentage on the redmine ticket.
The code uses actions/github and actions/core to access PR context to grab necessary data to pass it through Redmine issues notes.
Also code listen for opended, closed or reopended status on your pull request.
The code interpolate PR context data and update Redmine issues resource with the following note added:
*PR CREATED*: ${pr.data.title} \n + pr.data.body + "\n" + pr.url,
Where
pr.data.title: is the PR title.pr.data.body: is the full PR 1st comment (Where we lookup for the Redmine issue link)pr.url: is the full reference url of the GitHub PR.
Note: We highly recommend to use a github/pull_request_template
- Use the example files on .github/worflow folder, rename the file/s and add it into your project's
.github/workflowsfolder. - Add the proper permission on your github repository under
Settings->Actions->General->ActionsPermissions->Allow all actions and reusable workflows
- Enable your Redmine REST API.
- Register your Redmine api key as
REDMINE_API_KEYin GitHub secrets. - Register your Redmine URL as
REDMINE_HOSTin GitHub secrets.
Note: Be sure that your REDMINE_HOST contains protocol such as https://redmine.company.com.
- Update the test.js
npm i- node test.js
npm run build
git add index.js dist
git commit -m 'wathever'
git push
- Create a new branch
- Update the action on the repository that's using it to use 42mate/redmine-integration-action@branch