defread_image
download_blob_to_tempfile do |file|
require"mini_magick"
image = MiniMagick::Image.new(file.path)
if image.valid?
yield image
else
logger.info "Skipping image analysis because ImageMagick doesn't support the file"
{}
endendrescueLoadError
logger.info "Skipping image analysis because the mini_magick gem isn't installed"
{}
rescueMiniMagick::Error => error
logger.error "Skipping image analysis due to an ImageMagick error: #{error.message}"
{}
end
CI完了したら通知するやつ、macOSだと `gh run watch && osascript -e 'display notification "run is done!" with title "Terminal"'` みたいなのでデスクトップ通知出せて便利そう / “Work with GitHub Actions in your terminal with GitHubCLI - The GitHub Blog” https://t.co/WyoKK8mRUX
We’ve made it easier to stay on top of in-progress workflow runs with gh run watch, which you can use to either follow along as a workflow run executes or combine with other tools to alert you when runs are finished. Combining gh run watch with, on Ubuntu, a command like notify-send means more time to wander off from your keyboard and do something like pet a cat or gaze at a plant.
function notify-github-actions-ci-finish() {
gh run watch -i10 && osascript -e 'display notification "run is done!" with title "Terminal"'
}
alias nci=notify-github-actions-ci-finish