Skip to content

chore: 🐝 Update SDK - Generate 0.10.0 #2

chore: 🐝 Update SDK - Generate 0.10.0

chore: 🐝 Update SDK - Generate 0.10.0 #2

name: Campsite PR Alerts
on:
pull_request:
types: [opened, closed, merged, ready_for_review, reopened, review_requested, auto_merge_enabled]
jobs:
post_to_campsite:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Post to Campsite
id: post_to_campsite
run: |
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then
STATUS_EMOJI="βšͺ"
elif [[ "${{ github.event.action }}" == "opened" || "${{ github.event.action }}" == "reopened" || "${{ github.event.action }}" == "ready_for_review" ]]; then
STATUS_EMOJI="🟒"
elif [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]]; then
STATUS_EMOJI="🟣"
elif [[ "${{ github.event.action }}" == "closed" ]]; then
STATUS_EMOJI="πŸ”΄"
fi
ACTION=${{ github.event.action }}
if [[ "${ACTION}" == "ready_for_review" ]]; then
ACTION="ready for review"
elif [[ "${ACTION}" == "reopened" ]]; then
ACTION="reopened"
elif [[ "${ACTION}" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]]; then
ACTION="merged"
fi
ESCAPED_TITLE=$(echo "${{ github.event.pull_request.title }}" | jq -Rr @json)
CONTENT="${STATUS_EMOJI} [${{github.event.pull_request.head.repo.full_name}}] Pull request ${ACTION} by ${{ github.event.pull_request.user.login }}: [#${{ github.event.pull_request.number }} ${ESCAPED_TITLE}](${{ github.event.pull_request.html_url }})"
echo "content=${CONTENT}" >> $GITHUB_OUTPUT
- name: Create Campsite message
uses: campsite/campsite-github-action@v1
with:
api_key: ${{ secrets.CAMPSITE_API_KEY }}
action_type: create_message
thread_id: ${{ secrets.CAMPSITE_PR_ALERTS_THREAD_ID }}
content: ${{ steps.post_to_campsite.outputs.content }}