Skip to content

feat: added schemas for upload requests #572

feat: added schemas for upload requests

feat: added schemas for upload requests #572

name: Send check results to CodeX chat
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
types: [opened, synchronize, reopened]
jobs:
send-message:
permissions:
actions: write
runs-on: ubuntu-22.04
env:
API_URL: "https://api.github.com/repos/${{ github.repository }}/actions/runs"
steps:
- name: Set commit_sha to pull request head sha and ref to pull request
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "REF=[${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})" >> $GITHUB_ENV
- name: Set commit_sha to pushed commit sha and ref to branch name
if: ${{ github.event_name == 'push' }}
run: |
echo "COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV
echo "REF=[${{ github.ref_name }}](https://github.com/${{ github.repository }}/tree/${{ github.ref }})" >> $GITHUB_ENV
- name: Wait for other checks to succeed
uses: lewagon/[email protected]
with:
ref: ${{ env.COMMIT_SHA }}
running-workflow-name: send-message
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 3
allowed-conclusions: success,skipped,cancelled,failure
# Find results of the actions with the same SHA as this action via github api and set them to env variable
- name: Get actions results
run: |
echo 'ACTIONS_RESULTS<<0x0a' >> $GITHUB_ENV
echo -e "**api** 👏 ${{ github.triggering_actor }}:\n${{ env.REF }}\n" >> $GITHUB_ENV
curl -s -X GET -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"\
"$API_URL" | jq -r '.workflow_runs[] | select(((.head_sha=="${{ env.COMMIT_SHA }}") and (.id != ${{ github.run_id }}))
and ((.conclusion == "success") or (.conclusion == "failure"))) | "\(.conclusion) [\(.name)](\(.html_url))" |
gsub("success"; "✅") | gsub("failure"; "❌")' >> $GITHUB_ENV
echo '0x0a' >> $GITHUB_ENV
- name: Send a message
uses: codex-team/action-codexbot-notify@v1
with:
webhook: ${{ secrets.CODEX_BOT_NOTIFY_NOTES_CHAT }}
message: "${{ env.ACTIONS_RESULTS }}"
parse_mode: 'markdown'
disable_web_page_preview: true