Skip to content

Test metadata access #962

Test metadata access

Test metadata access #962

Workflow file for this run

name: Test metadata access
on:
push:
branches:
- main
pull_request:
branches:
- "*"
schedule:
- cron: "55 */6 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
invalid-metadata:
runs-on:
- namespace-profile-default
steps:
- uses: actions/checkout@v4
- run: |
sudo mkdir -p /cache/.ns
sudo chown -R runner /cache
echo "foo" > /cache/.ns/cache-metadata.json
# Should not fail despite cache-metadata being invalid.
- name: Set up NPM cache
uses: ./ # Uses an action in the root directory
with:
path: .npm
env:
NSC_CACHE_PATH: /cache
- name: Print cache metadata file
run: cat /cache/.ns/cache-metadata.json
owned-by-root:
runs-on:
- namespace-profile-default
steps:
- uses: actions/checkout@v4
- run: |
sudo mkdir -p /cache/.ns
sudo chown -R runner /cache
echo "{}" > /cache/.ns/cache-metadata.json
sudo chown -R root /cache/.ns
# Should not fail despite cache-metadata being owned by root.
- name: Set up NPM cache
uses: ./ # Uses an action in the root directory
with:
path: .npm
env:
NSC_CACHE_PATH: /cache
- name: Print cache metadata file
run: |
ls -al /cache/.ns
cat /cache/.ns/cache-metadata.json