Skip to content

Commit

Permalink
Simplify cloning the repo independently.
Browse files Browse the repository at this point in the history
  • Loading branch information
dumol committed Oct 4, 2024
1 parent 1c43bbd commit 46b3f64
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,26 +288,13 @@ jobs:
useradd -g adm -s /bin/bash -m chevah
echo '%adm ALL=NOPASSWD: ALL' > /etc/sudoers
# GHA's checkout action fails on CentOS 5/6, issue same commands manually.
# This fails when opening a new PR, but works starting with second commit.
- name: Clone sources independently
run: |
cd /home/chevah/
git init $CHEVAH_REPO
git clone https://github.com/chevah/$CHEVAH_REPO
cd $CHEVAH_REPO
# Cleanup the repo.
git rev-parse --symbolic-full-name --verify --quiet HEAD || true
git rev-parse --symbolic-full-name --branches || true
git remote remove origin || true
# Update repo token.
git remote add origin https://github.com/chevah/$CHEVAH_REPO
git fetch --no-tags --prune origin
# Prepare the code.
git clean -f
git reset --hard ${{ github.event.after }}
git log -1 --format='%H'
# This action also fails on CentOS 5/6.
git checkout ${GITHUB_HEAD_REF}
- name: Cache build
uses: actions/cache@v4
if: matrix.container != 'proatria/centos:5.11-chevah1' && matrix.container != 'centos:6.10'
Expand Down

0 comments on commit 46b3f64

Please sign in to comment.