Skip to content

Commit fad7659

Browse files
committed
fix: Don’t rely on 'rsync', since it’s not guaranteed to be installed
1 parent aac24e2 commit fad7659

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/actions/gh-cache/cache/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ runs:
2828
working-directory: ${{ github.action_path }}
2929
shell: bash
3030
run: |
31-
RUNNER_WORK_DIR="$(realpath ${GITHUB_WORKSPACE}/../..)"
31+
RUNNER_WORK_DIR="$(realpath "${GITHUB_WORKSPACE}/../..")"
3232
ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current"
33-
mkdir -p ${ACTION_DIR}/.github/actions
34-
rsync -a ../../../../.github/actions/ ${ACTION_DIR}/.github/actions/
33+
mkdir -p "${ACTION_DIR}/.github/actions"
34+
if [ "$(realpath .github/actions)" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then
35+
cp -a "../../../../.github/actions/." "${ACTION_DIR}/.github/actions/"
36+
fi
3537
- name: Restore cached value
3638
uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/restore
3739
with:

action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ runs:
4444
working-directory: ${{ github.action_path }}
4545
shell: bash
4646
run: |
47-
RUNNER_WORK_DIR="$(realpath ${GITHUB_WORKSPACE}/../..)"
47+
RUNNER_WORK_DIR="$(realpath "${GITHUB_WORKSPACE}/../..")"
4848
ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current"
49-
mkdir -p ${ACTION_DIR}/.github/actions
50-
rsync -a .github/actions/ ${ACTION_DIR}/.github/actions/
49+
mkdir -p "${ACTION_DIR}/.github/actions"
50+
if [ "$(realpath .github/actions)" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then
51+
cp -a ".github/actions/." "${ACTION_DIR}/.github/actions/"
52+
fi
5153
- name: Restore cached results
5254
id: restore
5355
uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/cache

0 commit comments

Comments
 (0)