From f5173ba24755ae7e47c471679eb5629a09505dee Mon Sep 17 00:00:00 2001 From: O01eg Date: Tue, 28 Jan 2025 22:48:53 +0400 Subject: [PATCH] Send private toot --- .github/workflows/build_weekly_scheduled.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_weekly_scheduled.yml b/.github/workflows/build_weekly_scheduled.yml index 3652886b2cf..4065a73f97f 100644 --- a/.github/workflows/build_weekly_scheduled.yml +++ b/.github/workflows/build_weekly_scheduled.yml @@ -17,7 +17,11 @@ jobs: echo ${{ github.token }} | gh auth login --with-token WORKFLOW_ID=$(gh api -X GET /repos/${{ github.repository }}/actions/runs/${{ github.run_id }} --jq='.workflow_id') TOTAL_COUNT=$(gh api -X GET "/repos/${{ github.repository }}/actions/workflows/${WORKFLOW_ID}/runs?status=success&per_page=1&head_sha=${{ github.sha }}" --jq '.total_count') - echo "Runs count: ${TOTAL_COUNT}" + echo "Runs success count: ${TOTAL_COUNT}" + if (( $TOTAL_COUNT == 0 )); then + TOTAL_COUNT=$(gh api -X GET "/repos/${{ github.repository }}/actions/workflows/${WORKFLOW_ID}/runs?status=in_progress&per_page=1&head_sha=${{ github.sha }}" --jq '.total_count') + echo "Runs in progress count: ${TOTAL_COUNT}" + fi echo "runs-count=${TOTAL_COUNT}" >> "$GITHUB_OUTPUT" macos: needs: check-run @@ -60,3 +64,12 @@ jobs: merge-multiple: true - name: Check artifacts run: ls -l . + - name: Toot + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.MASTODON_ACCESS_TOKEN }}" \ + -H "Idempotency-Key: ${{ github.sha }}" \ + --data-raw 'status=@o01eg@pawoo.net Test Build ${{ github.sha }}' \ + -d 'visibility=direct' \ + -d 'language=en' \ + https://fosstodon.org/api/v1/statuses