Skip to content

Commit

Permalink
auto-merge.yaml updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Md-Rubel-Ahmed-Rana committed Jul 3, 2024
1 parent 037864f commit 4e5e2c1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,31 @@ jobs:

steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.ref }}
fetch-depth: 0

- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Merge to main
id: merge
run: |
git fetch origin main
git checkout main
git merge --no-ff --allow-unrelated-histories ${{ github.event.ref }}
git merge --no-ff --allow-unrelated-histories ${{ github.event.ref }} || echo "Merge conflict detected" > conflict.txt
- name: Check for conflicts
if: failure()
run: |
cat conflict.txt
exit 1
- name: Push changes to main
if: success()
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
Expand Down

0 comments on commit 4e5e2c1

Please sign in to comment.