chore: add macos check for ios self hosted runner check

This commit is contained in:
DIYgod 2025-04-22 18:57:29 +08:00
parent 3343ddb658
commit e847740205
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -25,9 +25,9 @@ jobs:
id: set-runner
run: |
runners=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RUNNER_GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners")
available=$(echo "$runners" | jq '.runners[]? | select(.status == "online" and .busy == false and .labels[] .name == "self-hosted")')
available=$(echo "$runners" | jq '.runners[]? | select(.status == "online" and .busy == false and .labels[] .name == "macOS")')
if [ -n "$available" ]; then
echo "runner-label=self-hosted" >> $GITHUB_OUTPUT
echo "runner-label=[self-hosted, macOS]" >> $GITHUB_OUTPUT
else
echo "runner-label=macos-latest" >> $GITHUB_OUTPUT
fi

View File

@ -32,9 +32,9 @@ jobs:
id: set-runner
run: |
runners=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RUNNER_GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners")
available=$(echo "$runners" | jq '.runners[]? | select(.status == "online" and .busy == false and .labels[] .name == "self-hosted")')
available=$(echo "$runners" | jq '.runners[]? | select(.status == "online" and .busy == false and .labels[] .name == "macOS")')
if [ -n "$available" ]; then
echo "runner-label=self-hosted" >> $GITHUB_OUTPUT
echo "runner-label=[self-hosted, macOS]" >> $GITHUB_OUTPUT
else
echo "runner-label=macos-latest" >> $GITHUB_OUTPUT
fi