Skip to content

Commit

Permalink
ci: add delay check in import markdown generation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lfleischmann committed Oct 9, 2024
1 parent c48f74c commit 961acfb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/schema-markdown-import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ jobs:
rm $GITHUB_WORKSPACE/wiki/reference/import/*.md 2>/dev/null || true
cp .generated/docs/import/*.md $GITHUB_WORKSPACE/wiki/reference/import
- name: Delay check
run: |
OWNER=${{ github.repository_owner }}
NAME="$(cut -f2 -d'/' <<< ${{ github.repository }})"
HEAD_SHA="${{ github.sha }}"
STATUS="in_progress"
BASE="/repos/${OWNER}/${NAME}/actions/workflows/schema-markdown-config.yml/runs"
REQUEST_URL="${BASE}?head_sha=${HEAD_SHA}&status=${STATUS}"
SHOULD_DELAY=$(gh api "$REQUEST_URL" --jq '.total_count > 0')
if [ "$SHOULD_DELAY" = "true" ]; then
echo "Config markdown generation job in progress, delaying to avoid conflicts"
sleep 60s
else
echo "No config markdown generation job in progress, continuing"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and push to wiki
working-directory: ./wiki
run: |
Expand Down

0 comments on commit 961acfb

Please sign in to comment.