Skip to content

here's a new test

here's a new test #2

name: Discourse Update
on:
issues:
types: [opened, edited]
jobs:
update_discourse:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Get Issue Details
id: issue_details
run: |
echo "title=${{ github.event.issue.title }}" >> $GITHUB_ENV
echo "body=${{ github.event.issue.body }}" >> $GITHUB_ENV
echo "author=${{ github.event.issue.user.login }}" >> $GITHUB_ENV
echo "status=${{ github.event.issue.state }}" >> $GITHUB_ENV
- name: Post Update to Discourse
run: |
DISCOURSE_API_TOKEN=$DISCOURSE_API_TOKEN
DISCOURSE_URL=$DISCOURSE_URL
ISSUE_TITLE="${{ env.title }}"
ISSUE_BODY="${{ env.body }}"
ISSUE_AUTHOR="${{ env.author }}"
ISSUE_STATUS="${{ env.status }}"
JSON_DATA="{\"title\": \"$ISSUE_TITLE\", \"body\": \"$ISSUE_BODY\", \"author\": \"$ISSUE_AUTHOR\", \"status\": \"$ISSUE_STATUS\", \"category\": 22}"
curl -X POST -H "Authorization: Bearer ${{ secrets.DISCOURSE_API_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA" "$DISCOURSE_URL/api/update_category"