Test metadata access #1020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |