chore: π Update SDK - Generate 0.9.5 #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}}]\nPull request ${ACTION} by ${{ github.event.pull_request.user.login }}:\n[#${{ 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 }} |