Skip to content

Commit

Permalink
fix: git pull only the current branch (#22)
Browse files Browse the repository at this point in the history
* fix: git pull only the current branch

* fix: add autostash

* try: use origin

* try: ref_name

* fix: select a name
  • Loading branch information
deemp authored Dec 21, 2023
1 parent 67c0105 commit 20eedd2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ env:
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
keep-outputs = true
# https://stackoverflow.com/a/71158878
git_pull: git pull --rebase origin ${{ github.head_ref || github.ref_name }}

jobs:
# Check if the action code changed
Expand Down Expand Up @@ -84,7 +86,7 @@ jobs:
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
git pull --rebase --autostash
${{ env.git_pull }} --autostash
git add dist
git commit -m "action: build the action" || echo ""
git add .
Expand Down Expand Up @@ -139,7 +141,7 @@ jobs:
uses: actions/checkout@v3

- name: Rebase
run: git pull --rebase
run: ${{ env.git_pull }}

- uses: nixbuild/nix-quick-install-action@v26
with:
Expand Down Expand Up @@ -178,7 +180,7 @@ jobs:
uses: actions/checkout@v3

- name: Rebase
run: git pull --rebase
run: ${{ env.git_pull }}

- uses: nixbuild/nix-quick-install-action@v25
with:
Expand Down Expand Up @@ -224,7 +226,7 @@ jobs:
uses: actions/checkout@v3

- name: Rebase
run: git pull --rebase
run: ${{ env.git_pull }}

- uses: nixbuild/nix-quick-install-action@v25
with:
Expand Down

0 comments on commit 20eedd2

Please sign in to comment.