Skip to content

quick test

quick test #211

name: Prerelease Notification
on:
push:
branches:
- atavism/pr-summary
workflow_run:
workflows:
- Publish releases
types:
- completed
workflow_dispatch:
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Generate PR Summary
id: pr-summary
run: |
REPO_URL="https://github.com/getlantern/lantern-client"
git fetch origin
PR_SUMMARY=$(git log lantern-8.0.0-beta...HEAD --pretty=format:"%h %s" | grep -E "#[0-9]+" | sed -E 's|#([0-9]+)|[#\1]('"$REPO_URL"'/pull/\1)|')
echo "::set-output name=summary::$PR_SUMMARY"
- name: Send Slack Notification
env:
SLACK_WEBHOOK_URL: ${{ secrets.LANTERN_APP_SLACK_RELEASES_WEBHOOK }}
run: |
SLACK_PAYLOAD=$(jq -n --arg text "*A new release is available!* 🚀\n\n${{ steps.pr-summary.outputs.summary }}" '{"text": $text}')
echo "Slack Payload Debug: $SLACK_PAYLOAD"
# curl -X POST -H 'Content-type: application/json' \
# --data "{\"text\":\"${SLACK_MESSAGE}\"}" $SLACK_WEBHOOK_URL