From b8828fc4f4dfd6f9abe7a5cc1e8a4269de357e02 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 26 Sep 2024 13:55:32 +0200 Subject: [PATCH 1/4] for tools check only changes in the REPO --- .github/workflows/autoupdate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 9be465a..18d4b45 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -109,7 +109,7 @@ jobs: ;; *) TITLE=$(python3 "${{ github.workspace }}/autoupdate/pr_text.py" --repo "$REPO" --log "${{ github.workspace }}/autoupdate.log" --shed "$REPO/.shed.yml" --out "${{ github.workspace }}/body.txt") - FILE_TO_CHECK= + FILE_TO_CHECK=${REPO} ;; esac # Check if there is a branch/PR that already exists From 3085c45fd793ed293fb8faafbb39a5d6a3ab39b0 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 26 Sep 2024 14:08:23 +0200 Subject: [PATCH 2/4] fix cases where the PR is closed and branch deleted --- .github/workflows/autoupdate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 18d4b45..046635e 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -162,7 +162,7 @@ jobs: fi fi echo "There are changes" - if [ "$PR_EXISTS" -eq 1 ]; then + if [ "$DIFF_BRANCH" = "origin/$REPO" ] ; then # Check if the last commit of the existing branch was manual LAST_AUTHOR=$(git log -1 --pretty=format:'%an' $DIFF_BRANCH) if [ "$LAST_AUTHOR" != "planemo-autoupdate" ]; then From a5ad00c5bd9dc048f92deef3f9f3a87658086f13 Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 26 Sep 2024 15:48:24 +0200 Subject: [PATCH 3/4] deal with autoupdate fails because of malformed xml. --- .github/workflows/autoupdate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 046635e..6c38676 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -93,6 +93,10 @@ jobs: cd "$REPO" # This may fail planemo autoupdate . --skiplist "${{ github.workspace }}/autoupdate/${{ matrix.upstream_repo_owner }}_${{ matrix.upstream_repo_name }}_skip_list" 2>&1 1> "${{ github.workspace }}/autoupdate.log" | tee "${{ github.workspace }}/autoupdate.err" || errors="${errors}\nCannot autoupdate $REPO, last line of stderr is\n$(tail -n 1 "${{ github.workspace }}/autoupdate.err")" + # Waiting for https://github.com/galaxyproject/planemo/issues/1478 to be solved + if [[ "$(tail -n 1 "${{ github.workspace }}/autoupdate.log")" = "Could not update"* ]]; then + errors="${errors}\n$(tail -n 1 "${{ github.workspace }}/autoupdate.log")\n$(tail -n 1 "${{ github.workspace }}/autoupdate.err")" + fi rm -f tool_test_output.* tools.yml cd - # Check if it changed something From 7e11d1196def50da8e4b2138dec428086e1c728d Mon Sep 17 00:00:00 2001 From: Lucille Delisle Date: Thu, 26 Sep 2024 22:58:38 +0200 Subject: [PATCH 4/4] keep exit code of 1 even with tee --- .github/workflows/autoupdate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 6c38676..1cb07b6 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -92,7 +92,11 @@ jobs: echo "Running autoupdate command..." cd "$REPO" # This may fail + # To get an exit code of 1 even with tee: + set -o pipefail planemo autoupdate . --skiplist "${{ github.workspace }}/autoupdate/${{ matrix.upstream_repo_owner }}_${{ matrix.upstream_repo_name }}_skip_list" 2>&1 1> "${{ github.workspace }}/autoupdate.log" | tee "${{ github.workspace }}/autoupdate.err" || errors="${errors}\nCannot autoupdate $REPO, last line of stderr is\n$(tail -n 1 "${{ github.workspace }}/autoupdate.err")" + # Restore + set +o pipefail # Waiting for https://github.com/galaxyproject/planemo/issues/1478 to be solved if [[ "$(tail -n 1 "${{ github.workspace }}/autoupdate.log")" = "Could not update"* ]]; then errors="${errors}\n$(tail -n 1 "${{ github.workspace }}/autoupdate.log")\n$(tail -n 1 "${{ github.workspace }}/autoupdate.err")"