Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: linuxmint/timeshift
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: mamolinux/timeshift
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: autosync-upstream
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jun 27, 2023

  1. Add auto sync workflows for master and stable

    - Add workflow to autosync upstream master branch
      every six hours
    - Add workflow to update stable branch everyday when
      a new version is released
    hsbasu committed Jun 27, 2023
    Copy the full SHA
    f82ba23 View commit details
Showing with 108 additions and 0 deletions.
  1. +58 −0 .github/workflows/auto-sync-upstream.yaml
  2. +50 −0 .github/workflows/update-stable.yml
58 changes: 58 additions & 0 deletions .github/workflows/auto-sync-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Automatically fetch and merge upstream master branch and tags

name: Scheduled Sync Upstream Action
on:
schedule:
# scheduled every 6 hours
- cron: '0 */6 * * *'

workflow_dispatch: # on button click
inputs:
upstream:
description: 'Upstream repository (eg. linuxmint/cinnamon)'
required: true
default: 'linuxmint/timeshift' # set the upstream repo
upstream-branch:
description: 'Upstream branch to merge from. Eg. master'
required: true
default: 'master' # set the upstream branch to merge from
branch:
description: 'Branch to merge to'
required: true
default: 'master' # set the branch to merge to

jobs:
# This workflow contains a single job called "sync-upstream"
sync-upstream:
runs-on: ubuntu-latest
steps:
# Set default branches when run as scheduled job
- name: Set the branches
env:
DEFAULT_UPSTREAM: 'linuxmint/timeshift' # set the upstream repo
DEFAULT_UPSTREAM_BRANCH: 'master' # set the upstream branch to merge from
DEFAULT_BRANCH: 'master' # set the branch to merge to
run: |
echo "upstream=${{ github.event.inputs.upstream || env.DEFAULT_UPSTREAM }}" >> $GITHUB_ENV
echo "upstream-branch=${{ github.event.inputs.upstream-branch || env.DEFAULT_UPSTREAM_BRANCH }}" >> $GITHUB_ENV
echo "branch=${{ github.event.inputs.branch || env.DEFAULT_BRANCH }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.branch }} # set the branch to merge to
# Number of commits to fetch. 0 indicates all history for all branches and tags.
fetch-depth: 0

- name: Fetch and Merge Upstream Branch
uses: exions/merge-upstream@v1
with:
upstream: ${{ env.upstream }}
upstream-branch: ${{ env.upstream-branch }}
branch: ${{ env.branch }}
token: ${{ secrets.TOKEN }}

- name: Push All Tags
run: |
git push origin --tags
50 changes: 50 additions & 0 deletions .github/workflows/update-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Automatically fetch and merge latest tag to mamolinux/stable for new stable releases
name: Update mamolinux/stable branch

# Controls when the action will run.
on:
schedule:
# scheduled every day at 00:00
- cron: '0 0 */1 * *'

workflow_dispatch: # on button click
inputs:
branch:
description: 'Branch to merge to'
required: true
default: 'mamolinux/stable' # set the branch to merge to

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "sync-new-release"
sync-new-release:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@master
with:
fetch-depth: 0

# Set default branches when run as scheduled job
- name: Set the branches
env:
DEFAULT_UPSTREAM_BRANCH: 'master' # set the upstream branch to merge from
DEFAULT_BRANCH: 'mamolinux/stable' # set the branch to merge to
run: |
git checkout ${{ env.DEFAULT_UPSTREAM_BRANCH }}
echo "latest-tag=`git log --oneline | cut -d " " -f 2 | grep -E '^[0-9]' | head -1`" >> $GITHUB_ENV
echo "branch=${{ github.event.inputs.branch || env.DEFAULT_BRANCH }}" >> $GITHUB_ENV
- name: Set Git config
run: |
git config --local user.email "actions@github.com"
git config --local user.name "Github Actions"
- name: Update mamolinux/stable for new release
run: |
git checkout ${{ env.branch }}
git merge --ff-only ${{ env.latest-tag }}
git push -f