Skip to content

update-dev

update-dev #944

Workflow file for this run

name: update-dev
on:
workflow_run:
workflows:
- Build Website - JSON
types:
- completed
branches:
- master
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
update-dev:
runs-on: ubuntu-latest
if: >-
${{
github.event_name != 'workflow_run' ||
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'push'
)
}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Nightly Merge
env:
PUSH_TOKEN: ${{ secrets.NIGHTLY_TOKEN }}
CONFIG_USERNAME: GitHub Nightly Merge Action
CONFIG_EMAIL: [email protected]
MERGE_HEAD: master
MERGE_BASE: dev
MERGE_ARGS: --no-ff --allow-unrelated-histories --no-edit
run: |
# This script is adapted from the robotology/[email protected] GitHub action:
# https://github.com/robotology/gh-action-nightly-merge/blob/master/entrypoint.sh
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git remote set-url origin https://x-access-token:${!PUSH_TOKEN}@github.com/PennyLaneAI/qml.git
git config --global user.name "$CONFIG_USERNAME"
git config --global user.email "$CONFIG_EMAIL"
git fetch origin
(git checkout $MERGE_HEAD && git pull)
(git checkout $MERGE_BASE && git pull)
git merge $MERGE_ARGS $MERGE_HEAD
git push origin $MERGE_BASE