Skip to content

Commit

Permalink
Update update-dev.yml to use git instead of third-party action (#…
Browse files Browse the repository at this point in the history
…1242)

The `update-dev` action keeps failing due to unrelated histories between
the `dev` and `master` branches, and the third party action used for the
nightly merge does not include any options to allow merging with
unrelated histories. So, this PR updates the action to use `git`
instead.

This will also give us more flexibility in the future.

Couple of updates:
* I have confirmed that configuring `git` using `secrets.NIGHTLY_TOKEN`
does not expose the token in the workflow logs. See
[here](https://github.com/PennyLaneAI/qml/actions/runs/11408914907/job/31748090296#step:3:4)
for an example.

[sc-76254]

---------

Co-authored-by: Rashid N H M <[email protected]>
  • Loading branch information
mudit2812 and rashidnhm authored Oct 25, 2024
1 parent 070e0c1 commit b69929b
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/update-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.NIGHTLY_TOKEN }}

- name: Nightly Merge
uses: robotology/[email protected]
with:
stable_branch: 'master'
development_branch: 'dev'
allow_ff: false
env:
GITHUB_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 user.name "$CONFIG_USERNAME"
git config --global user.email "$CONFIG_EMAIL"
git fetch origin $MERGE_HEAD
(git checkout $MERGE_HEAD && git pull)
git fetch origin $MERGE_BASE
(git checkout $MERGE_BASE && git pull)
git merge $MERGE_ARGS $MERGE_HEAD
git push origin $MERGE_BASE

0 comments on commit b69929b

Please sign in to comment.