Skip to content

Add support for artifact_id input and improve artifact selection for … #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

morningstarxcdcode
Copy link

@morningstarxcdcode morningstarxcdcode commented Jun 3, 2025

improvements:

  1. Adds a new input artifact_id to allow explicit deployment by artifact ID, addressing ambiguity when multiple artifacts share the same name.

  2. If artifact_id is provided, it is used for both deployment and as the unique build version, improving reliability for reruns and special workflow events.

  3. Updates documentation (README.md and action.yml) to describe the new input and clarify its behavior.

  4. Adds a warning in the documentation about file modification dates being overridden by GitHub Pages.

  5. Adds and passes tests for the new logic.

Usage Example:

  • uses: actions/deploy-pages@v4 with: artifact_id: ${{ steps.upload.outputs.artifact-id }}

If artifact_id is set, it overrides artifact_name and is used for both deployment and as the build version.

pls review and let me know

@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 03:27
@morningstarxcdcode morningstarxcdcode requested a review from a team as a code owner June 3, 2025 03:27
Copy link

@Copilot 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.

Pull Request Overview

This PR adds support for an optional artifact_id input, which allows users to explicitly specify the artifact to deploy and use it as the build version for uniqueness. Key changes include:

  • Adding artifact_id extraction in the context and using it in the deployment process.
  • Adjusting deployment logic to bypass metadata fetching when artifact_id is provided.
  • Updating tests, action configuration, and documentation accordingly.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/internal/deployment.js Introduces artifact_id handling in deployment logic and logging
src/internal/context.js Adds artifact_id extraction from inputs
src/tests/internal/deployment.test.js Adds tests to verify deployment when artifact_id is provided
action.yml Updates inputs to add artifact_id
README.md Documents the artifact_id behavior in deployment

let artifactIdToUse = this.artifactId;
let buildVersionToUse = this.buildVersion;

if (artifactIdToUse) {
Copy link
Preview

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

Consider adding an inline comment explaining that when artifact_id is provided, artifactData is not fetched and the size check is skipped. This will clarify the intended behavior for future maintainers.

Copilot uses AI. Check for mistakes.

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.

1 participant