-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,16 +49,21 @@ jobs: | |
cargo run --release > cargo.log 2>&1 & | ||
sleep 10 | ||
cat cargo.log | ||
osascript -e 'tell application "System Events" to tell process "infoskjerm" to set frontmost to true' | ||
osascript -e 'delay 10' | ||
WINDOW_ID=$(osascript -e 'tell application "System Events" to return id of window of process "infoskjerm"') | ||
echo "Window ID: $WINDOW_ID" # Print the window ID | ||
screencapture -l$WINDOW_ID screenshot.png | ||
window_info=$(osascript -e 'tell application "System Events" to tell process "infoskjerm" to get {position, size} of window 1') | ||
x=$(echo $window_info | cut -d, -f1) | ||
y=$(echo $window_info | cut -d, -f2) | ||
w=$(echo $window_info | cut -d, -f3) | ||
h=$(echo $window_info | cut -d, -f4) | ||
rectangle="${x},${y},${w},${h}" | ||
rectangle=$(echo $rectangle | tr -d ' ') | ||
screencapture -R$rectangle screenshot.png | ||
- name: Commit and push screenshot | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Add screenshot" -a | ||
git add screenshot.png | ||
git commit -m "Add updated screenshot" -a | ||
git push |