Booking: Relative cancelling date should be at end of day (23:59:59) #387
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Labeled ERPNext Task | |
on: | |
issues: | |
types: | |
- labeled | |
jobs: | |
create-task: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Format Payload | |
run: | | |
sanitize() { | |
echo "$1" | jq -R '.' | sed 's/^"//;s/"$//' | |
} | |
SANITIZED_TITLE=$(sanitize "${{ github.event.issue.title }}") | |
SANITIZED_BODY=$(sanitize "${{ github.event.issue.body }}") | |
echo '{ | |
"subject": "GH#${{ github.event.issue.number }} - '"$SANITIZED_TITLE"'", | |
"project": "${{ github.event.label.name }}", | |
"status": "Open", | |
"description": "<p><a href=\"${{ github.event.issue.html_url }}\">GH#${{ github.event.issue.number }}</a></p><br>'"$SANITIZED_BODY"'" | |
}' > payload.json | |
- name: Make API Request to ERPNext | |
run: | | |
curl --fail -X POST -H "Content-Type: application/json" -H "Authorization: ${{ secrets.WEBHOOK_TOKEN }}" -d @payload.json https://erp.wunderbyte.at/api/resource/Task |