Auto Merge vers dev #401
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Merge vers dev | |
on: | |
push: | |
branches-ignore: | |
- master | |
- dev | |
- docker | |
schedule: | |
- cron: "*/1 * * * *" # toutes les 1 minute | |
jobs: | |
merge-to-dev: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configurer Git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Push commits de la branche source si nécessaire | |
run: | | |
# Récupère le nom de la branche source | |
BRANCH=${{ github.ref_name }} | |
# Checkout de la branche source | |
git checkout $BRANCH | |
# Push les commits locaux éventuels | |
git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }} $BRANCH || echo "Rien à push" | |
- name: Merge dans dev | |
run: | | |
BRANCH=${{ github.ref_name }} | |
git fetch origin dev | |
git checkout dev | |
git pull origin dev | |
git merge $BRANCH --no-edit | |
git push https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }} dev |