Skip to content

Commit

Permalink
feat: add github action to update the develop branch when a new commi…
Browse files Browse the repository at this point in the history
…t to main is made
  • Loading branch information
pranavmishra90 committed Nov 14, 2024
1 parent 4dc2b24 commit cd2fa23
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/merge-main-onto-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Merge Main onto Develop

on:
push:
branches:
- main

permissions:
contents: write

jobs:
update-develop:
runs-on: ubuntu-latest

# This action should only run on the main repository, not forks
if: ${{ github.repository == 'FacsimiLab/facsimilab-platform' }} # Only run on main repository

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: true
set-safe-directory: '/'

- name: Read the image version
id: package
uses: juliangruber/read-file-action@v1
with:
path: ${{ github.workspace }}/docker/image_version.txt

- name: Merge Main onto Develop
run: |
git checkout develop
git merge main --no-edit
git push origin develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Matrix Message - Completed GitHub Action
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "FacsimiLab ${{ steps.package.outputs.content }} - Updated the `develop` branch from `main` at https://github.com/FacsimiLab/facsimilab-platform"
server: "matrix.drpranavmishra.com"

0 comments on commit cd2fa23

Please sign in to comment.