Skip to content

Add Support for @actions/artifact#136

Merged
ncalteen merged 8 commits intomainfrom
ncalteen/artifact
Jan 7, 2025
Merged

Add Support for @actions/artifact#136
ncalteen merged 8 commits intomainfrom
ncalteen/artifact

Conversation

@ncalteen
Copy link
Collaborator

@ncalteen ncalteen commented Jan 7, 2025

This PR introduces support for stubbing the functionality of the @actions/artifact package. This is accomplished via the following:

  • Copies all required components of the @actions/artifact package.
  • Adds a new environment variable, LOCAL_ACTION_ARTIFACT_PATH, which can be used to set the local directory where @actions/artifact will "upload" and "download" artifacts.
  • Adds a check for the LOCAL_ACTION_ARTIFACT_PATH environment variable whenever @actions/artifact operations are performed.
  • Adds new properties to environment metadata for tracking artifacts that have been created as part of a local-action run (currently no cleanup of those artifacts is performed).

Important

Operations on artifacts in external repositories is left implemented as-is. If you specify the findBy options as noted here, the corresponding GitHub API will be called.

@ncalteen ncalteen self-assigned this Jan 7, 2025
Copilot AI review requested due to automatic review settings January 7, 2025 20:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 30 out of 45 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • .env.example: Language not supported
  • tests/stubs/artifact/internal/delete/delete-artifact.test.ts: Evaluated as low risk
  • tests/commands/run.test.ts: Evaluated as low risk
  • tests/stubs/core-stubs.test.ts: Evaluated as low risk
  • tests/command.test.ts: Evaluated as low risk
  • tests/utils/output.test.ts: Evaluated as low risk
  • tests/index.test.ts: Evaluated as low risk
  • tests/stubs/summary-stubs.test.ts: Evaluated as low risk
  • tests/stubs/env-stubs.test.ts: Evaluated as low risk
  • tests/stubs/artifact/internal/upload/upload-artifact.test.ts: Evaluated as low risk
  • docs/supported-functionality.md: Evaluated as low risk
  • tests/stubs/artifact/internal/client.test.ts: Evaluated as low risk
  • fixtures/stream/promises.ts: Evaluated as low risk
  • fixtures/fs.ts: Evaluated as low risk
  • fixtures/crypto.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)

tests/stubs/artifact/internal/find/list-artifacts.test.ts:12

  • [nitpick] The function name 'listArtifactsInternal' is ambiguous. Consider renaming it to 'listEnvArtifacts' to indicate that it lists artifacts from the environment metadata.
describe('list-artifacts', () => {

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

@github-actions
Copy link

github-actions bot commented Jan 7, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 4 0 0.04s
✅ JAVASCRIPT prettier 11 0 1.21s
✅ JSON jsonlint 23 0 0.52s
✅ JSON npm-package-json-lint yes no 1.2s
✅ JSON prettier 23 0 1.48s
✅ MARKDOWN markdownlint 8 0 3.12s
✅ REPOSITORY checkov yes no 24.51s
✅ REPOSITORY gitleaks yes no 2.67s
✅ REPOSITORY git_diff yes no 0.03s
✅ REPOSITORY grype yes no 17.55s
✅ REPOSITORY secretlint yes no 0.97s
✅ REPOSITORY trivy yes no 11.97s
✅ REPOSITORY trivy-sbom yes no 0.94s
✅ REPOSITORY trufflehog yes no 28.14s
✅ TYPESCRIPT prettier 56 0 4.19s
✅ YAML prettier 21 0 1.66s
✅ YAML yamllint 21 0 1.0s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@ncalteen ncalteen merged commit 1b5783f into main Jan 7, 2025
4 checks passed
@ncalteen ncalteen deleted the ncalteen/artifact branch January 7, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants