Skip to content

Commit

Permalink
Update merge-upstream.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWert authored and github-actions committed Nov 2, 2023
1 parent be97af5 commit 30ec5f0
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/merge-upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,37 @@ jobs:
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
- name: Merge Upstream
uses: exions/merge-upstream@v1
with:
upstream: open-telemetry/opentelemetry-demo
upstream-branch: main
branch: main
fetch-depth: 0
- name: fetch and push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPSTREAM: https://github.com/open-telemetry/opentelemetry-demo
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
if [ "$(git status | grep diverged)" ]; then
git push origin $(git branch --show-current) --force-with-lease;
fi;
notify-failure:
needs: [merge_upstream]
if: always() && needs.merge_upstream.result != 'success'
runs-on: ubuntu-latest
steps:
- name: Get previous workflow status
uses: Mercymeilya/[email protected]
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Slack notification
if: success() && steps.last_status.outputs.last_status == 'success'
env:
SLACK_WEBHOOK: ${{ secrets.OTELSLACKCHANNELWEBHOOK }}
SLACK_UNFURL_LINKS: "true"
Expand Down

0 comments on commit 30ec5f0

Please sign in to comment.