diff --git a/.github/workflows/git-commands.yaml b/.github/workflows/git-commands.yaml index 7c7a05e81e..7e8a5e2acf 100644 --- a/.github/workflows/git-commands.yaml +++ b/.github/workflows/git-commands.yaml @@ -82,6 +82,10 @@ jobs: run: | set -e # Exit on any command failure PR_NUMBER=${{ github.event.issue.number }} + + # Set up error trap to comment on PR for any failure + trap 'gh pr comment $PR_NUMBER --body "❌ SQLx update failed. Please check the workflow logs for details."' ERR + BRANCH_NAME=$(gh pr view $PR_NUMBER --json headRefName --jq .headRefName) echo "Checking out PR branch: $BRANCH_NAME" git checkout $BRANCH_NAME @@ -93,10 +97,8 @@ jobs: cd backend cargo install sqlx-cli --version 0.8.5 sqlx migrate run - if ! ./update_sqlx.sh --dir ./windmill-ee-private; then - gh pr comment $PR_NUMBER --body "❌ SQLx update failed. Please check the workflow logs for details." - exit 1 - fi + ./substitute_ee_code.sh --dir ./windmill-ee-private + ./update_sqlx.sh # Pass the branch name to the next step echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV @@ -216,11 +218,12 @@ jobs: with: github-token: ${{ steps.app.outputs.token }} script: | + const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Starting ee ref update...' + body: `Starting ee ref update...\n\n[View workflow run](${runUrl})` }) - name: Checkout repository @@ -249,7 +252,12 @@ jobs: env: GH_TOKEN: ${{ steps.app.outputs.token }} run: | + set -e # Exit on any command failure PR_NUMBER=${{ github.event.issue.number }} + + # Set up error trap to comment on PR for any failure + trap 'gh pr comment $PR_NUMBER --body "❌ EE ref update failed. Please check the workflow logs for details."' ERR + BRANCH_NAME=$(gh pr view $PR_NUMBER --json headRefName --jq .headRefName) echo "Checking out PR branch: $BRANCH_NAME" git checkout $BRANCH_NAME diff --git a/backend/update_sqlx.sh b/backend/update_sqlx.sh index 5425706876..669aa90dc9 100755 --- a/backend/update_sqlx.sh +++ b/backend/update_sqlx.sh @@ -2,15 +2,6 @@ set -e -# Parse arguments -while [[ "$#" -gt 0 ]]; do - case $1 in - --dir) EE_DIR="$2"; shift ;; - *) echo "Unknown parameter: $1"; exit 1 ;; - esac - shift -done - # Check if running on macOS if [[ "$(uname)" == "Darwin" ]]; then echo "Running on macOS - substituting samael..."