Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/actions/configure-macos-screen-recording/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Configure macOS screen recording
description: Configure a GitHub-hosted macOS runner for tray screenshots and UI automation.

runs:
using: composite
steps:
- name: Configure macOS screen recording
shell: bash
run: |
set -euo pipefail

brew install cliclick
clickTool="$(command -v cliclick)"

configure_system_tccdb() {
local values=$1
local dbPath="/Library/Application Support/com.apple.TCC/TCC.db"
local sqlQuery="INSERT OR IGNORE INTO access VALUES($values);"
sudo sqlite3 -cmd ".timeout 30000" "$dbPath" "$sqlQuery"
}

configure_user_tccdb() {
local values=$1
local dbPath="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
local sqlQuery="INSERT OR IGNORE INTO access VALUES($values);"
sqlite3 -cmd ".timeout 30000" "$dbPath" "$sqlQuery"
}

systemValuesArray=(
"'kTCCServiceScreenCapture','/bin/bash',1,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1599831148"
"'kTCCServicePostEvent','/bin/bash',1,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1599831148"
"'kTCCServicePostEvent','$clickTool',1,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1599831148"
)
for values in "${systemValuesArray[@]}"; do
configure_system_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
done

userValuesArray=(
"'kTCCServiceScreenCapture','/bin/bash',1,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1583997993"
"'kTCCServicePostEvent','/bin/bash',1,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1583997993"
"'kTCCServicePostEvent','$clickTool',1,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1583997993"
)
for values in "${userValuesArray[@]}"; do
configure_user_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
done

preflightScreenshot="$RUNNER_TEMP/screen-capture-preflight.png"
screencapture -x "$preflightScreenshot"
sleep 1
"$clickTool" kp:return
sleep 1

echo "macOS screen recording configured."
36 changes: 36 additions & 0 deletions .github/actions/configure-windows-tray-screenshots/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Configure Windows tray screenshots
description: Configure a GitHub-hosted Windows runner for visible tray icons and notifications.

runs:
using: composite
steps:
- name: Configure Windows tray screenshots
shell: pwsh
run: |
echo "::group::Enable all tray icons"
$trayIconScript = Join-Path $env:RUNNER_TEMP "Enable-AllTrayIcons.ps1"
Invoke-WebRequest `
-Uri "https://raw.githubusercontent.com/paulmann/windows-show-all-tray-icons/main/Enable-AllTrayIcons.ps1" `
-OutFile $trayIconScript
& $trayIconScript -Action Enable -Force
echo "::endgroup::"

echo "::group::Disable Do Not Disturb"
Add-Type -AssemblyName System.Windows.Forms
Start-Process "ms-settings:notifications"
Start-Sleep -Seconds 2
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
[System.Windows.Forms.SendKeys]::SendWait(" ")
echo "::endgroup::"

echo "::group::Minimize all windows"
$shell = New-Object -ComObject Shell.Application
$shell.MinimizeAll()
echo "::endgroup::"

echo "::group::Set Date - Hack for Quiet Time"
$newDate = (Get-Date).AddHours(2)
Set-Date -Date $newDate
echo "::endgroup::"
Loading
Loading