Skip to content

Don't fail on buildkite-agent redactor add error - #21

Merged
v1v merged 2 commits into
mainfrom
copilot/support-no-redaction
May 22, 2026
Merged

v1v merged 2 commits into
mainfrom
copilot/support-no-redaction

Conversation

Copilot AI commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

On Windows 2016 (and any agent without BUILDKITE_AGENT_JOB_API_SOCKET set), buildkite-agent redactor add fails fatally, causing the plugin to abort before the token is exported.

image

Changes

  • hooks/pre-command: Made redaction non-fatal — failure emits a stderr warning and execution continues. Token redaction is best-effort; missing Job API socket should not block token delivery.
# Before
echo "${VAULT_GITHUB_TOKEN}" | buildkite-agent redactor add

# After
echo "${VAULT_GITHUB_TOKEN}" | buildkite-agent redactor add \
  || echo "WARNING: Failed to add token to Buildkite redactor. The token may appear in logs." >&2
  • tests/asset.bats: Added test asserting the hook succeeds and emits the warning when buildkite-agent redactor add exits non-zero.

Copilot AI assigned Copilot and v1v May 22, 2026
Copilot AI linked an issue May 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix issue with echoing VAULT_GITHUB_TOKEN Don't fail on buildkite-agent redactor add error May 22, 2026
Copilot finished work on behalf of v1v May 22, 2026 11:05
Copilot AI requested a review from v1v May 22, 2026 11:05
@v1v
v1v marked this pull request as ready for review May 22, 2026 11:08
@v1v
v1v requested a review from a team as a code owner May 22, 2026 11:08
@v1v v1v added the changelog:fix When a bug is fixed label May 22, 2026

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n 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.

LGTM

@v1v
v1v merged commit 66da887 into main May 22, 2026
4 of 5 checks passed
@v1v
v1v deleted the copilot/support-no-redaction branch May 22, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:fix When a bug is fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support no redaction

3 participants