Skip to the content.

Solution: Event - Discussion

name: Event - Discussion

on:
  discussion:
    types: [created, edited, deleted]

jobs:
  handle-discussion:
    runs-on: ubuntu-latest

    steps:
      - name: Print full event payload
        run: |
          echo "Full event payload:"
          echo "$"

      - name: Print discussion metadata
        run: |
          echo "🗣️ Event Type: $"
          echo "📌 Title: $"
          echo "✍️ Author: $"
          echo "📝 Category: $"
          echo "💬 Body: $"

      - name: On Create
        if: github.event.action == 'created'
        run: echo "🎉 A new discussion was created!"

      - name: On Edit
        if: github.event.action == 'edited'
        run: echo "✏️ A discussion was edited!"

      - name: On Delete
        if: github.event.action == 'deleted'
        run: echo "🗑️ A discussion was deleted!"