Skip to content

Commit

Permalink
Don't use the Nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
akirak committed Nov 2, 2023
1 parent 56820d6 commit 4ee86a2
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/merge-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,46 @@ jobs:
ref: akirak

- name: Switch to a work branch
run: git switch -C upstream-recipes
id: start
run: |
git switch -C upstream-recipes
echo "rev=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Fetch the upstream
id: upstream
run: |
git remote add upstream https://github.com/melpa/melpa.git
git fetch upstream master
echo "ref=upstream/master" >> "$GITHUB_OUTPUT"
- uses: DeterminateSystems/nix-installer-action@v4
with:
diagnostic-endpoint: ''

- name: Merge upstream recipes
- name: Configure the Git identity
run: |
# Set some identity. Actually it will be overridden later, so it's
# unused
# Set some identity. Actually it will be overridden later by git-filter-repo,
# so it can be anything
git config --add user.name 'github-actions[bot]'
git config --add user.email '6270544+github-actions[bot]@users.noreply.github.com'
nix run github:emacs-twist/recipes-updater/remain-on-tmp-branch#forceUpdate \
--no-write-lock-file -- upstream/master
git rebase akirak
- name: Retrieve the merge base
id: merge-base
run: |
rev=$(git merge-base ${{ steps.upstream.outputs.ref }} ${{ steps.start.outputs.rev }})
echo "rev=$rev" >> "$GITHUB_OUTPUT"
- name: Filter commits
run: |
tmp="recipes-$(date +%s)"
git switch -c "$tmp" ${{ steps.upstream.outputs.ref }}
nix run nixpkgs#git-filter-repo -- \
--path recipes/ --refs "${{ steps.merge-base.outputs.rev }}..HEAD" \
--commit-callback '
commit.committer_name = commit.author_name
commit.committer_email = commit.author_email
commit.committer_date = commit.author_date
' --force
# A workaround to prevent peter-evans/create-pull-request from resetting the
# head here:
Expand All @@ -48,7 +68,7 @@ jobs:
- name: Create a pull request
uses: peter-evans/create-pull-request@v5
with:
base: akirak
base: ${{ steps.merge-base.outputs.rev }}
token: ${{ secrets.PAT_FOR_PR }}
title: 'Merge the upstream recipe commits'
branch: create-pull-request/merge-recipes
Expand Down

0 comments on commit 4ee86a2

Please sign in to comment.