From 2656527d3cd15dac856ef48ef9024f47e7bdbdf7 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 28 Oct 2022 16:46:10 +0700 Subject: [PATCH] throw warnings if action_install.sh is used and repo does not have 'arduino-library' tag in its topic --- .github/workflows/githubci.yml | 4 ++-- actions_install.sh | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/githubci.yml b/.github/workflows/githubci.yml index a7334c71..e86995d6 100644 --- a/.github/workflows/githubci.yml +++ b/.github/workflows/githubci.yml @@ -8,8 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: pre-install diff --git a/actions_install.sh b/actions_install.sh index 37f6f588..fcd99442 100644 --- a/actions_install.sh +++ b/actions_install.sh @@ -32,3 +32,12 @@ echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh arduino-cli config init > /dev/null arduino-cli core update-index > /dev/null + +# warn if this library does not have arduino-library tag in its topic +if [ $GITHUB_REPOSITORY != "adafruit/ci-arduino" ]; then + repo_topics=$(curl --request GET --url "https://api.github.com/repos/$GITHUB_REPOSITORY" | jq -r '.topics[]' | xargs) + if [[ ! $repo_topics =~ "arduino-library" ]]; then + echo "::warning::arduino-library is not found in this repo topics. Please add this tag in repo About" + fi +fi +