Skip to content

sample issue, to see what data is available via webhooks #26

sample issue, to see what data is available via webhooks

sample issue, to see what data is available via webhooks #26

name: Discourse Update
on:
issues:
types: [opened]
jobs:
update_discourse:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Fetch CSRF Token
id: csrf_token
run: |
CSRF_TOKEN=$(curl -s https://goodbids.discourse.group/session/csrf.json | jq -r .csrf)
- name: Post New Issue to Discourse
run: |
JSON_DATA="${{ env.JSON_DATA }}"
CSRF_TOKEN="${{ env.CSRF_TOKEN }}"
curl -X POST "https://goodbids.discourse.group/posts.json" \
-H "Content-Type: application/json" \
-H "Api-Key: ${{ secrets.DISCOURSE_UPDATE_SECRET }}" \
-H "Api-Username: jaspercroome" \
-H "X-CSRF-Token: $CSRF_TOKEN" \
-d '{
"title": "Github issue#${{github.event.issue.number}} - ${{ github.event.issue.title }}",
"raw": "${{ github.event.issue }}",
"category": 22
}'