-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add github action to update the develop branch when a new commi…
…t to main is made
- Loading branch information
1 parent
4dc2b24
commit cd2fa23
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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" |