From 0bfb3939813d5da9e198de6d4cc1e2afc38a7021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Qui=C3=B1ones?= Date: Sat, 15 Nov 2025 08:49:27 -0500 Subject: [PATCH] ci: add workflow to revert last beta update (#169) --- .github/workflows/revert-beta.yml | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/revert-beta.yml diff --git a/.github/workflows/revert-beta.yml b/.github/workflows/revert-beta.yml new file mode 100644 index 0000000..4a5e518 --- /dev/null +++ b/.github/workflows/revert-beta.yml @@ -0,0 +1,37 @@ +name: Revert Beta Update + +on: + workflow_dispatch: + +jobs: + revert-beta-update: + name: Revert last beta update + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Find last beta update commit + id: find_commit + run: | + commit_hash=$(git log --oneline --grep="^chore(update):.*beta @" | head -1 | awk '{print $1}') + if [ -z "$commit_hash" ]; then + echo "No beta update commit found" + exit 1 + fi + echo "commit_hash=$commit_hash" >> $GITHUB_OUTPUT + + - name: Revert the commit + run: | + git revert --no-edit ${{ steps.find_commit.outputs.commit_hash }} + git commit --amend --no-edit -m "$(git log -1 --pretty=%B | sed 's/Revert/revert:/')" + git push