From f1b8dd22951b9de5095711f9e0efb273b3e209d9 Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Wed, 11 Sep 2024 14:09:15 -0400
Subject: [PATCH] mirror.yaml: Set pending EICweb status (#53)

---
 .github/workflows/mirror.yaml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml
index 17fdc2e7..8595d08f 100644
--- a/.github/workflows/mirror.yaml
+++ b/.github/workflows/mirror.yaml
@@ -16,6 +16,7 @@ jobs:
     permissions:
       actions: write
       contents: read
+      statuses: write
     steps:
     - name: Checkout
       uses: actions/checkout@v4
@@ -41,3 +42,17 @@ jobs:
           GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }}
           GITHUB_PR=${{ github.event.pull_request.number }}
           PIPELINE_NAME=${{ github.repository }}: ${{ github.event.pull_request.title || github.ref_name }}
+    - name: Set pending EICweb status
+      if: ${{ github.event_name != 'delete' }}
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        DETECTOR_CONFIG: epic_craterlake
+      run: |
+        curl \
+          --fail-with-body \
+          -X POST \
+          -H "Accept: application/vnd.github+json" \
+          -H "Authorization: Bearer $GITHUB_TOKEN" \
+          -H "X-GitHub-Api-Version: 2022-11-28" \
+          -d '{"context": "eicweb/detector_benchmarks ('"$DETECTOR_CONFIG"')", "state": "pending", "description": "Waiting for response from the EICweb"}' \
+          "https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha || github.sha }}"
-- 
GitLab