From aac24e25ab962da2d3047e7bdaf2398e5e40751b Mon Sep 17 00:00:00 2001 From: Clay Miller Date: Tue, 2 Dec 2025 09:40:30 -0500 Subject: [PATCH 1/3] fix: Make paths compatible with both GitHub-hosted and self-hosted runners --- .github/actions/gh-cache/cache/action.yml | 11 ++++++----- action.yml | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/actions/gh-cache/cache/action.yml b/.github/actions/gh-cache/cache/action.yml index 7577a39..fc1ebb7 100644 --- a/.github/actions/gh-cache/cache/action.yml +++ b/.github/actions/gh-cache/cache/action.yml @@ -28,11 +28,12 @@ runs: working-directory: ${{ github.action_path }} shell: bash run: | - mkdir -p /home/runner/work/_actions/current/.github/actions - rsync -a ../../../../.github/actions/ /home/runner/work/_actions/current/.github/actions/ - ls -ltra /home/runner/work/_actions/current/.github/actions + RUNNER_WORK_DIR="$(realpath ${GITHUB_WORKSPACE}/../..)" + ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current" + mkdir -p ${ACTION_DIR}/.github/actions + rsync -a ../../../../.github/actions/ ${ACTION_DIR}/.github/actions/ - name: Restore cached value - uses: ./../../_actions/current/.github/actions/gh-cache/restore + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/restore with: path: ${{ inputs.key }} token: ${{ inputs.token }} @@ -48,7 +49,7 @@ runs: - if: ${{ inputs.value }} name: Save cached value - uses: ./../../_actions/current/.github/actions/gh-cache/save + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/save with: path: ${{ inputs.key }} token: ${{ inputs.token }} diff --git a/action.yml b/action.yml index 3c519bb..66b9737 100644 --- a/action.yml +++ b/action.yml @@ -44,12 +44,13 @@ runs: working-directory: ${{ github.action_path }} shell: bash run: | - mkdir -p /home/runner/work/_actions/current/.github/actions - rsync -a .github/actions/ /home/runner/work/_actions/current/.github/actions/ - ls -ltra /home/runner/work/_actions/current/.github/actions + RUNNER_WORK_DIR="$(realpath ${GITHUB_WORKSPACE}/../..)" + ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current" + mkdir -p ${ACTION_DIR}/.github/actions + rsync -a .github/actions/ ${ACTION_DIR}/.github/actions/ - name: Restore cached results id: restore - uses: ./../../_actions/current/.github/actions/gh-cache/cache + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/cache with: key: ${{ inputs.cache_key }} token: ${{ inputs.token }} @@ -66,20 +67,20 @@ runs: - if: ${{ inputs.login_url && inputs.username && inputs.password && !inputs.auth_context }} name: Authenticate id: auth - uses: ./../../_actions/current/.github/actions/auth + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/auth with: login_url: ${{ inputs.login_url }} username: ${{ inputs.username }} password: ${{ inputs.password }} - name: Find id: find - uses: ./../../_actions/current/.github/actions/find + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/find with: urls: ${{ inputs.urls }} auth_context: ${{ inputs.auth_context || steps.auth.outputs.auth_context }} - name: File id: file - uses: ./../../_actions/current/.github/actions/file + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/file with: findings: ${{ steps.find.outputs.findings }} repository: ${{ inputs.repository }} @@ -96,7 +97,7 @@ runs: - if: ${{ inputs.skip_copilot_assignment != 'true' }} name: Fix id: fix - uses: ./../../_actions/current/.github/actions/fix + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/fix with: issues: ${{ steps.get_issues_from_filings.outputs.issues }} repository: ${{ inputs.repository }} @@ -126,7 +127,7 @@ runs: FILINGS: ${{ steps.file.outputs.filings }} FIXINGS: ${{ steps.fix.outputs.fixings }} - name: Save cached results - uses: ./../../_actions/current/.github/actions/gh-cache/cache + uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/cache with: key: ${{ inputs.cache_key }} value: ${{ steps.results.outputs.results }} From fad7659d8883926c56d4d36fbc07441633ef0feb Mon Sep 17 00:00:00 2001 From: Clay Miller Date: Tue, 2 Dec 2025 09:55:29 -0500 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20Don=E2=80=99t=20rely=20on=20'rsync',?= =?UTF-8?q?=20since=20it=E2=80=99s=20not=20guaranteed=20to=20be=20installe?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/gh-cache/cache/action.yml | 8 +++++--- action.yml | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/actions/gh-cache/cache/action.yml b/.github/actions/gh-cache/cache/action.yml index fc1ebb7..af70949 100644 --- a/.github/actions/gh-cache/cache/action.yml +++ b/.github/actions/gh-cache/cache/action.yml @@ -28,10 +28,12 @@ runs: working-directory: ${{ github.action_path }} shell: bash run: | - RUNNER_WORK_DIR="$(realpath ${GITHUB_WORKSPACE}/../..)" + RUNNER_WORK_DIR="$(realpath "${GITHUB_WORKSPACE}/../..")" ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current" - mkdir -p ${ACTION_DIR}/.github/actions - rsync -a ../../../../.github/actions/ ${ACTION_DIR}/.github/actions/ + mkdir -p "${ACTION_DIR}/.github/actions" + if [ "$(realpath .github/actions)" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then + cp -a "../../../../.github/actions/." "${ACTION_DIR}/.github/actions/" + fi - name: Restore cached value uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/restore with: diff --git a/action.yml b/action.yml index 66b9737..07b2be4 100644 --- a/action.yml +++ b/action.yml @@ -44,10 +44,12 @@ runs: working-directory: ${{ github.action_path }} shell: bash run: | - RUNNER_WORK_DIR="$(realpath ${GITHUB_WORKSPACE}/../..)" + RUNNER_WORK_DIR="$(realpath "${GITHUB_WORKSPACE}/../..")" ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current" - mkdir -p ${ACTION_DIR}/.github/actions - rsync -a .github/actions/ ${ACTION_DIR}/.github/actions/ + mkdir -p "${ACTION_DIR}/.github/actions" + if [ "$(realpath .github/actions)" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then + cp -a ".github/actions/." "${ACTION_DIR}/.github/actions/" + fi - name: Restore cached results id: restore uses: ./../../_actions/github/accessibility-scanner/current/.github/actions/gh-cache/cache From e3611c2c356eaeb83dddf02a545df3c0f2322122 Mon Sep 17 00:00:00 2001 From: Clay Miller Date: Tue, 2 Dec 2025 09:57:27 -0500 Subject: [PATCH 3/3] fix: Improve guard that prevents errors when copying a file over itself --- .github/actions/gh-cache/cache/action.yml | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/gh-cache/cache/action.yml b/.github/actions/gh-cache/cache/action.yml index af70949..c403530 100644 --- a/.github/actions/gh-cache/cache/action.yml +++ b/.github/actions/gh-cache/cache/action.yml @@ -31,7 +31,7 @@ runs: RUNNER_WORK_DIR="$(realpath "${GITHUB_WORKSPACE}/../..")" ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current" mkdir -p "${ACTION_DIR}/.github/actions" - if [ "$(realpath .github/actions)" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then + if [ "$(realpath "../../../../.github/actions")" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then cp -a "../../../../.github/actions/." "${ACTION_DIR}/.github/actions/" fi - name: Restore cached value diff --git a/action.yml b/action.yml index 07b2be4..c4ee5bd 100644 --- a/action.yml +++ b/action.yml @@ -47,7 +47,7 @@ runs: RUNNER_WORK_DIR="$(realpath "${GITHUB_WORKSPACE}/../..")" ACTION_DIR="${RUNNER_WORK_DIR}/_actions/github/accessibility-scanner/current" mkdir -p "${ACTION_DIR}/.github/actions" - if [ "$(realpath .github/actions)" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then + if [ "$(realpath ".github/actions")" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then cp -a ".github/actions/." "${ACTION_DIR}/.github/actions/" fi - name: Restore cached results