Skip to content

Commit

Permalink
fix(action): Fix Docker caching permission error
Browse files Browse the repository at this point in the history
GitHub Actions doesn't grant us permission to cache the Docker root
directory even if Docker is running in rootless mode. Instead, on cache
miss, export the images to a TAR archive at a path we have permission to
cache and subsequently load from on cache hit. Composite actions don't
yet support post steps, so port to a TypeScript action since Docker
images can't be saved until after the calling workflow pulls or builds
them. Use Yarn Zero-Installs, because dependencies of GitHub Actions
must be version controlled, and Yarn Zero-Installs works by compressing
and tracking all Node.js dependencies. Check in the dist directory
output by TypeScript since GitHub Actions requires its presence in order
to run the action and cannot directly execute TypeScript. Add cache-hit
output so callers can branch if needed.
  • Loading branch information
Kurt-von-Laven committed Apr 23, 2022
1 parent 0c5aee8 commit e6d02d6
Show file tree
Hide file tree
Showing 304 changed files with 17,112 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@
# Normalize line endings of all text files to LF when copying them from the
# repository to the working directory, such as when checking them out.
* text eol=lf

# Yarn generates some minified JavaScript files that are technically text, but
# that we don't want Git to check for whitespace errors.
*.cjs binary

# As of 2022-04-21, Git mistakenly categorizes Yarn cache files as textual.
*.zip binary
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ report/

# Poetry
.venv

# Yarn Zero-Installs
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 1 addition & 1 deletion .jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"maxSize": 0,
"threshold": 0,
"reporters": ["consoleFull", "console"],
"ignore": [".git", ".venv"],
"ignore": [".git", ".venv", ".yarn"],
"gitignore": true,
"blame": true,
"ignoreCase": true
Expand Down
3 changes: 3 additions & 0 deletions .mega-linter.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
APPLY_FIXES: all
FILTER_REGEX_EXCLUDE: \.pnp\.(c|loader\.m)js|\.yarn/|dist
DEFAULT_BRANCH: main
FAIL_IF_MISSING_LINTER_IN_FLAVOR: true
FORMATTERS_DISABLE_ERRORS: false
PRINT_ALPACA: false
SHOW_ELAPSED_TIME: true
CREDENTIALS_SECRETLINT_ARGUMENTS: --secretlintignore .gitignore
JAVASCRIPT_DEFAULT_STYLE: prettier
JSON_PRETTIER_FILE_EXTENSIONS:
- .json
- .md
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.yaml
SPELL_CSPELL_CONFIG_FILE: LINTER_DEFAULT
TYPESCRIPT_DEFAULT_STYLE: prettier
Loading

0 comments on commit e6d02d6

Please sign in to comment.