Skip to content

Commit 862db39

Browse files
authored
Force branch overwrite in metadata nightly job (#15092)
1 parent e12631d commit 862db39

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/metadata-update.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,7 @@ jobs:
7070
run: |
7171
BRANCH_NAME="otelbot/metadata-update-main"
7272
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
73-
if git ls-remote --exit-code --heads origin "$BRANCH_NAME"; then
74-
git fetch origin "$BRANCH_NAME"
75-
git checkout "$BRANCH_NAME"
76-
git merge origin/main --no-edit
77-
else
78-
git checkout -b "$BRANCH_NAME" origin/main
79-
fi
73+
git checkout -B "$BRANCH_NAME"
8074
8175
- name: Commit and push changes
8276
if: steps.diffcheck.outputs.has_diff == 'true'
@@ -85,7 +79,7 @@ jobs:
8579
run: |
8680
BRANCH_NAME="${{ steps.findbranch.outputs.branch }}"
8781
git commit -m "chore: update instrumentation list [automated]" || echo "No changes to commit."
88-
git push origin "$BRANCH_NAME"
82+
git push --force origin "$BRANCH_NAME"
8983
9084
- name: Create PR if needed
9185
if: steps.diffcheck.outputs.has_diff == 'true'
@@ -119,3 +113,14 @@ jobs:
119113
else
120114
echo "No open PR found for branch $BRANCH_NAME."
121115
fi
116+
117+
workflow-notification:
118+
permissions:
119+
contents: read
120+
issues: write
121+
needs:
122+
- update
123+
if: always()
124+
uses: ./.github/workflows/reusable-workflow-notification.yml
125+
with:
126+
success: ${{ needs.update.result == 'success' }}

0 commit comments

Comments
 (0)