.github/workflows: use treeless-checkout-action

This commit is contained in:
classabbyamp 2023-01-28 06:46:52 -05:00 committed by Michael Aldridge
parent cf1389ff69
commit 08f062aad3
2 changed files with 3 additions and 48 deletions

View File

@ -27,22 +27,7 @@ jobs:
steps: steps:
- name: Clone and checkout - name: Clone and checkout
run: | uses: classabbyamp/treeless-checkout-action@v1
REMOTE_REF=$(echo ${{ github.ref }} | sed 's;refs/;refs/remotes/;')
/bin/echo -e '::group::\x1b[32mCloning repository...\x1b[0m'
git clone --progress --no-checkout --filter=tree:0 \
"${{ github.server_url }}/${{ github.repository }}" "$PWD"
git config --global --add gc.auto 0
git config --global --add safe.directory "$PWD"
echo "::endgroup::"
/bin/echo -e '::group::\x1b[32mFetching repository refs...\x1b[0m'
git fetch --prune --progress --filter=tree:0 origin \
+refs/heads/*:refs/remotes/origin/* \
+${{ github.ref }}:"${REMOTE_REF}"
echo "::endgroup::"
/bin/echo -e '::group::\x1b[32mChecking out repository...\x1b[0m'
git checkout --progress --force "${REMOTE_REF}"
echo "::endgroup::"
- run: common/travis/changed_templates.sh - run: common/travis/changed_templates.sh
- run: common/travis/fetch-xbps.sh - run: common/travis/fetch-xbps.sh
- run: common/travis/fetch-xtools.sh - run: common/travis/fetch-xtools.sh
@ -87,22 +72,7 @@ jobs:
xbps-install -yu xbps-install -yu
- name: Clone and checkout - name: Clone and checkout
run: | uses: classabbyamp/treeless-checkout-action@v1
REMOTE_REF=$(echo ${{ github.ref }} | sed 's;refs/;refs/remotes/;')
/bin/echo -e '::group::\x1b[32mCloning repository...\x1b[0m'
git clone --progress --no-checkout --filter=tree:0 \
"${{ github.server_url }}/${{ github.repository }}" "$PWD"
git config --global --add gc.auto 0
git config --global --add safe.directory "$PWD"
echo "::endgroup::"
/bin/echo -e '::group::\x1b[32mFetching repository refs...\x1b[0m'
git fetch --prune --progress --filter=tree:0 origin \
+refs/heads/*:refs/remotes/origin/* \
+${{ github.ref }}:"${REMOTE_REF}"
echo "::endgroup::"
/bin/echo -e '::group::\x1b[32mChecking out repository...\x1b[0m'
git checkout --progress --force "${REMOTE_REF}"
echo "::endgroup::"
- name: Create hostrepo and prepare masterdir - name: Create hostrepo and prepare masterdir
run: | run: |
ln -s "$(pwd)" /hostrepo && ln -s "$(pwd)" /hostrepo &&

View File

@ -27,22 +27,7 @@ jobs:
xbps-install -y python3-networkx github-cli xbps-install -y python3-networkx github-cli
- name: Clone and checkout - name: Clone and checkout
run: | uses: classabbyamp/treeless-checkout-action@v1
REMOTE_REF=$(echo ${{ github.ref }} | sed 's;refs/;refs/remotes/;')
/bin/echo -e '::group::\x1b[32mCloning repository...\x1b[0m'
git clone --progress --no-checkout --filter=tree:0 \
"${{ github.server_url }}/${{ github.repository }}" "$PWD"
git config --global --add gc.auto 0
git config --global --add safe.directory "$PWD"
echo "::endgroup::"
/bin/echo -e '::group::\x1b[32mFetching repository refs...\x1b[0m'
git fetch --prune --progress --filter=tree:0 origin \
+refs/heads/*:refs/remotes/origin/* \
+${{ github.ref }}:"${REMOTE_REF}"
echo "::endgroup::"
/bin/echo -e '::group::\x1b[32mChecking out repository...\x1b[0m'
git checkout --progress --force "${REMOTE_REF}"
echo "::endgroup::"
- name: Create hostrepo and prepare masterdir - name: Create hostrepo and prepare masterdir
run: | run: |