From 4082cbabb7d075d26370dbee18d43befc9dbd289 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Wed, 22 Oct 2025 07:49:23 -0400 Subject: [PATCH] Force branch overwrite in metadata job --- .github/workflows/metadata-update.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/metadata-update.yml b/.github/workflows/metadata-update.yml index fa217a527a90..ecfa6bd2340c 100644 --- a/.github/workflows/metadata-update.yml +++ b/.github/workflows/metadata-update.yml @@ -70,13 +70,7 @@ jobs: run: | BRANCH_NAME="otelbot/metadata-update-main" echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT - if git ls-remote --exit-code --heads origin "$BRANCH_NAME"; then - git fetch origin "$BRANCH_NAME" - git checkout "$BRANCH_NAME" - git merge origin/main --no-edit - else - git checkout -b "$BRANCH_NAME" origin/main - fi + git checkout -B "$BRANCH_NAME" - name: Commit and push changes if: steps.diffcheck.outputs.has_diff == 'true' @@ -85,7 +79,7 @@ jobs: run: | BRANCH_NAME="${{ steps.findbranch.outputs.branch }}" git commit -m "chore: update instrumentation list [automated]" || echo "No changes to commit." - git push origin "$BRANCH_NAME" + git push --force origin "$BRANCH_NAME" - name: Create PR if needed if: steps.diffcheck.outputs.has_diff == 'true' @@ -119,3 +113,14 @@ jobs: else echo "No open PR found for branch $BRANCH_NAME." fi + + workflow-notification: + permissions: + contents: read + issues: write + needs: + - update + if: always() + uses: ./.github/workflows/reusable-workflow-notification.yml + with: + success: ${{ needs.update.result == 'success' }}