From 8fcf257726dc1d6ef848451962c9ace373714a91 Mon Sep 17 00:00:00 2001 From: Etienne Dechamps Date: Thu, 29 Feb 2024 23:52:36 +0000 Subject: [PATCH] Fix check workflow failing on pull requests This fixes the following check GitHub Actions workflow failure that would otherwise occur on pull requests (but not on pushes/branches): Error installing Git Library: Library install failed: object not found --- .github/workflows/check.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4b1c029..80186da 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -40,6 +40,13 @@ jobs: WiFiManager@2.0.16-rc.2 Arduino_JSON@0.2.0 U8g2@2.34.22 + # In some cases, actions/checkout@v4 will check out a detached HEAD; for + # example, this happens on pull request events, where an hypothetical + # PR merge commit is checked out. This tends to confuse + # `arduino-cli lib install --git-url`, making it fail with errors such as: + # Error installing Git Library: Library install failed: object not found + # Create and check out a dummy branch to work around this issue. + - run: git checkout -b check - run: bin/arduino-cli --verbose lib install --git-url . env: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL: "true"