From f8c8e9e21d751f1b4f125a2f488912fa35dc65e0 Mon Sep 17 00:00:00 2001 From: "Thing-han, Lim" <15379156+potsrevennil@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:28:34 +0800 Subject: [PATCH] ci: drop local gh-pages commit if bench result is not pushed to gh-pages If benchmark result is not pushed to gh-pages, on a consecutive benchmark step, there will be a non-fast-forward git fetch error Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> --- .github/actions/bench/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/bench/action.yml b/.github/actions/bench/action.yml index 97c5e64e9..56969df1f 100644 --- a/.github/actions/bench/action.yml +++ b/.github/actions/bench/action.yml @@ -97,3 +97,10 @@ runs: comment-on-alert: true summary-always: true alert-threshold: ${{ inputs.alert_threshold }} + - name: Reset gh-pages if result is not pushed to gh-pages + shell: ${{ env.SHELL }} + if: ${{ inputs.store_results != 'true' }} + run: | + git -c advice.detachedHead=false switch gh-pages + git reset --hard HEAD~1 + git checkout -