Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/actions/gh-cache/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ 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"
if [ "$(realpath "../../../../.github/actions")" != "$(realpath "${ACTION_DIR}/.github/actions")" ]; then
cp -a "../../../../.github/actions/." "${ACTION_DIR}/.github/actions/"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smockle just checking since I hadn't seen -a before (manpages say "Preserves structure and attributes of files but not directory structure"), is this intentional vs using something like -r to recursively copy everything?

Copy link
Collaborator Author

@smockle smockle Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question! cp -a includes -R; from https://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html#index-_002da-7:

…Equivalent to -dR --preserve=all with the reduced diagnostics.

If you’re familiar with rsync, rsync -a (archive) is similar.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah oops, there we go -- misremembered the flag as lowercase -r!

Copy link
Collaborator Author

@smockle smockle Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POSIX cp only supports -R: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/cp.html

GNU cp supports -R and -r: https://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html#index-_002dR-3

The latter doc explains the difference:

It is not portable to use -r to copy symbolic links or special files. On some non-GNU systems, -r implies the equivalent of -L and --copy-contents for historical reasons. Also, it is not portable to use -R to copy symbolic links unless you also specify -P, as POSIX allows implementations that dereference symbolic links by default.

Those differences aren’t enormously significant in our case: This repo doesn’t include symbolic links, and the ubuntu-latest runner’s cp supports both -R and -r. Regardless, our command (cp -a) is portable, because -a includes -d, and -d includes --no-dereference (aka -P).

fi
- 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 }}
Expand All @@ -48,7 +51,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 }}
Expand Down
21 changes: 12 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ 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"
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/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 }}
Expand All @@ -66,20 +69,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 }}
Expand All @@ -96,7 +99,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 }}
Expand Down Expand Up @@ -126,7 +129,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 }}
Expand Down