Skip to content

Github action

Github action #7

name: Notify Discord on PR Merge to Main
on:
pull_request:
types: [closed] # Trigger when a PR is closed (merged or not)
jobs:
notify-discord:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' # Only run if the PR was merged into main
runs-on: ubuntu-latest
steps:
- name: Verify Webhook URL
run: echo "Webhook URL is set"
if: "${{ secrets.DISCORD_WEBHOOK_URL != '' }}"

Check failure on line 15 in .github/workflows/pr-merged-discord.yml

View workflow run for this annotation

GitHub Actions / Notify Discord on PR Merge to Main

Invalid workflow file

The workflow is not valid. .github/workflows/pr-merged-discord.yml (Line: 15, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DISCORD_WEBHOOK_URL != ''
- name: Send notification to Discord
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\": \"A PR has been merged into the main branch! 🎉 \nRepository: ${{ github.repository }}\nMerged by: ${{ github.actor }}\nPR Title: ${{ github.event.pull_request.title }}\nPR Link: ${{ github.event.pull_request.html_url }}\"}" \
"${{ secrets.DISCORD_WEBHOOK_URL }}"