Skip to content

feat: add context-action for uploading context data#39

Merged
vik-nullify merged 2 commits intomainfrom
feat/context-action
Mar 26, 2026
Merged

feat: add context-action for uploading context data#39
vik-nullify merged 2 commits intomainfrom
feat/context-action

Conversation

@vik-nullify
Copy link
Copy Markdown
Member

@vik-nullify vik-nullify commented Mar 25, 2026

Summary

  • New composite GitHub Action at context-action/action.yml
  • Usage: uses: Nullify-Platform/nullify-cloud-connector/context-action@v1
  • Installs Nullify CLI, then runs mode-based decision logic
  • Mode matrix: merge-only (push only), pr-only (PR only), both (upload on PR, cleanup on close)
  • Auto-detects PR number, draft status, merge state from GitHub event context

Example usage

- uses: Nullify-Platform/nullify-cloud-connector/context-action@v1
  with:
    nullify-token: ${{ secrets.NULLIFY_API_KEY }}
    type: terraform
    name: networking
    plan-path: infrastructure/plan.json

Test plan

  • Test in a sample repo with mode: merge-only on push to main
  • Test with mode: both on PR open/sync/close
  • Verify draft PR skipping
  • Verify dry-run mode

🤖 Generated with Claude Code

vik-nullify and others added 2 commits March 25, 2026 04:35
New composite GitHub Action at context-action/action.yml.
Usage: uses: Nullify-Platform/nullify-cloud-connector/context-action@v1

- Installs Nullify CLI, then delegates to entrypoint.sh
- Mode decision matrix: merge-only, pr-only, both
- Auto-detects PR number, draft status from GitHub event context
- Supports terraform plans, CI logs, and other context types
- Inputs: nullify-token, type, name, mode, environment, plan-path,
  skip-on-draft, dry-run
- Outputs: action-taken, upload-path

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Security fixes:
- Use bash arrays for CLI args (prevents command injection via inputs)
- Safe jq parsing with error handling
- Check if CLI is already installed before curl|bash

Logic fixes:
- Default plan-path to **/plan.json when empty
- Upload each file separately with name derived from parent directory
  (e.g. infrastructure/networking/plan.json → name=infrastructure/networking)
- Make name optional — auto-derived from file path, overridable
- Proper glob expansion into array

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vik-nullify vik-nullify marked this pull request as ready for review March 25, 2026 05:16
@vik-nullify vik-nullify requested a review from HarvWorks March 25, 2026 08:09
@vik-nullify vik-nullify merged commit 405ab89 into main Mar 26, 2026
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