Skip to content

Commit

Permalink
ci: switch to auto merge strategy (#23)
Browse files Browse the repository at this point in the history
Auto rebase rewrites commit history, thus removing references
to current tags
  • Loading branch information
rogercoll authored Jun 20, 2024
1 parent 0e258cc commit 69a5a6a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/merge-upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
merge_upstream:
runs-on: ubuntu-latest
steps:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
Expand All @@ -18,20 +18,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
UPSTREAM: https://github.com/open-telemetry/opentelemetry-demo
run: |
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git remote add upstream "${UPSTREAM}"
# Get all recent branches and commits from the upstream
git fetch upstream main
git rebase upstream/main
git merge upstream/main --no-edit || { echo "Merge conflicts detected. Please resolve them manually."; exit 1; }
git push origin $(git branch --show-current)
if [ "$(git status | grep diverged)" ]; then
git push origin $(git branch --show-current) --force;
fi;
notify-failure:
needs: [merge_upstream]
if: always() && needs.merge_upstream.result != 'success'
Expand All @@ -53,4 +52,4 @@ jobs:
:wave:
Auto-merge of the <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|elastic/opentelemetry-demo> repository with the upstream failed!
Manual resolution of the merge conflicts is required!

0 comments on commit 69a5a6a

Please sign in to comment.