Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devops: move microphone access into own action #30634

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/actions/enable-microphone-access/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Enable Microphone Access (macOS)
description: 'Allow microphone access to all apps on macOS'

runs:
using: composite
steps:
# https://github.com/actions/runner-images/issues/9330
- name: Allow microphone access to all apps
shell: bash
run: |
if [[ "$(uname)" != "Darwin" ]]; then
echo "Not macOS, exiting"
exit 0
fi
echo "Allowing microphone access to all apps"
version=$(sw_vers -productVersion | cut -d. -f1)
if [[ "$version" == "14" ]]; then
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
elif [[ "$version" == "12" || "$version" == "13" ]]; then
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access VALUES('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159);"
else
echo "macOS version is unsupported. Version is $version, exiting"
exit 1
fi
echo "Successfully allowed microphone access"
9 changes: 1 addition & 8 deletions .github/actions/run-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ runs:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
# https://github.com/actions/runner-images/issues/9330
- name: Allow microphone access to all apps (macOS 14)
shell: bash
run: |
if [[ "$(uname)" == "Darwin" && "$(sw_vers -productVersion | cut -d. -f1)" == "14" ]]; then
echo "Allowing microphone access to all apps"
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
fi
- uses: ./.github/actions/enable-microphone-access
- run: npm ci
shell: bash
env:
Expand Down