Skip to content

feat: Add structured multi-server Maven credentials input#1037

Open
brunoborges wants to merge 4 commits into
actions:mainfrom
brunoborges:feat/mvn-server-credentials
Open

feat: Add structured multi-server Maven credentials input#1037
brunoborges wants to merge 4 commits into
actions:mainfrom
brunoborges:feat/mvn-server-credentials

Conversation

@brunoborges

@brunoborges brunoborges commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a new mvn-server-credentials multiline input with format server-id:USERNAME_ENV:PASSWORD_ENV
  • generate multiple entries in Maven settings.xml from that structured input
  • keep backward compatibility by falling back to server-id / server-username / server-password when the new input is not set
  • add parser validation for malformed lines and duplicate server ids
  • update tests and docs (README + advanced usage)

Why

This keeps the feature surface focused while supporting the core multi-repository use case without introducing indexed input tuples.

Compatibility

Existing workflows using server-id, server-username, and server-password continue to work unchanged.

Closes #85

Introduce mvn-server-credentials to support multiple Maven server entries in settings.xml while keeping existing single-server inputs as fallback. Update auth generation/parsing logic, tests, action metadata, and docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 configuring multiple Maven <server> credentials in a single run via a new structured multiline input, while preserving the existing single-server inputs as a fallback.

Changes:

  • Introduces mvn-server-credentials multiline input (server-id:USERNAME_ENV:PASSWORD_ENV) and parsing/validation (malformed entries, duplicate server IDs).
  • Updates Maven settings.xml generation to emit multiple <server> entries.
  • Updates action metadata + documentation and extends unit tests for the new behavior.
Show a summary per file
File Description
src/mvn.setting.definition.ts Adds a shared type for Maven server settings entries.
src/constants.ts Adds a constant for the new mvn-server-credentials input name.
src/auth.ts Implements multiline input parsing + multi-server settings.xml generation with legacy fallback.
README.md Documents the new input and its override behavior.
docs/advanced-usage.md Adds an “Multiple repositories” example and expected generated settings.xml.
action.yml Registers the new multiline input for the action.
__tests__/auth.test.ts Updates tests for new function signatures + adds coverage for multi-server generation and parsing.
dist/setup/index.js Bundled output updated to include the new parsing/generation behavior.
dist/cleanup/index.js Bundled constants updated to include the new input constant.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 7/9 changed files
  • Comments generated: 2

Comment thread src/auth.ts
import * as constants from './constants';
import * as gpg from './gpg';
import {getBooleanInput} from './util';
import {MvnSettingDefinition} from './mvn.setting.definition';
Comment on lines +2 to +6
id: string;
username?: string;
password?: string;
gpgPassphrase?: string;
}
@brunoborges brunoborges added feature request New feature or request to improve the current logic maven Maven settings, toolchains, and publishing auth labels Jun 22, 2026
@brunoborges brunoborges changed the title Add structured multi-server Maven credentials input feat: Add structured multi-server Maven credentials input Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request to improve the current logic maven Maven settings, toolchains, and publishing auth

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for multiple servers.

2 participants