Skip to content

feat(cli): per-message send_at scheduling on messages send + message-to (#623) #46

feat(cli): per-message send_at scheduling on messages send + message-to (#623)

feat(cli): per-message send_at scheduling on messages send + message-to (#623) #46

Workflow file for this run

name: Feature PR to Main
on:
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.1.7
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v5.3.0
with:
python-version: '3.12'
- name: Install CLI and test deps
run: |
pip install -e .
pip install pytest
- name: Run tests
run: pytest tests/ -v --tb=short
auto-merge:
needs: test
runs-on: ubuntu-latest
steps:
- name: Auto-merge PR
run: gh pr merge ${{ github.event.pull_request.number }} --squash --auto
env:
GH_TOKEN: ${{ secrets.GOVIND_GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
notify-merge:
needs: auto-merge
runs-on: ubuntu-latest
steps:
- name: Create merge confirmation cue
run: |
FIRE_AT=$(date -u -d '+2 minutes' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || \
date -u -v+2M '+%Y-%m-%dT%H:%M:%SZ')
curl -s -w "\n%{http_code}" -X POST https://api.cueapi.ai/v1/cues \
-H "Authorization: Bearer ${{ secrets.ARGUS_CUEAPI_KEY }}" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"cueapi-cli-merged-${{ github.event.pull_request.number }}\",
\"schedule\": {\"type\": \"once\", \"at\": \"${FIRE_AT}\"},
\"transport\": \"worker\",
\"payload\": {
\"task\": \"test-cli\",
\"trigger\": \"post-merge\",
\"repo\": \"cueapi/cueapi-cli\",
\"pr_number\": \"${{ github.event.pull_request.number }}\",
\"commit_sha\": \"${{ github.event.pull_request.head.sha }}\"
}
}"