git2jamf icon indicating copy to clipboard operation
git2jamf copied to clipboard

Implement support for extension attribute scripts

Open Copilot opened this issue 5 months ago • 1 comments

This PR adds comprehensive support for extension attribute scripts in git2jamf, addressing the original limitation where EA scripts weren't supported due to API constraints that have since been resolved.

Key Features

Extension Attribute Script Support: Scripts can now be automatically created and updated as Jamf Pro extension attributes using the modern API (/uapi/v1/computer-extension-attributes).

Directory Separation: Added ea_script_dir parameter to target a specific folder for extension attribute scripts. When enabled, these scripts are processed separately from regular scripts to prevent conflicts.

Automatic Exclusion: EA script directories are automatically excluded from regular script scanning, ensuring scripts are only processed in their intended context.

Usage

- name: git2jamf
  uses: jgarcesres/git2jamf@main
  with: 
    jamf_url: ${{ secrets.jamf_url }}
    jamf_username: ${{ secrets.jamf_username }}
    jamf_password: ${{ secrets.jamf_password }}
    script_dir: 'scripts'
    ea_script_dir: 'extension-attributes'  # New parameter

Implementation Details

  • Modern API Integration: Migrated from legacy /JSSResource/ endpoints to new /uapi/v1/computer-extension-attributes API
  • Full CRUD Operations: Support for creating, updating, and deleting extension attributes with hash-based change detection
  • Enhanced Error Handling: Comprehensive error messages and troubleshooting guidance for API compatibility issues
  • Robust Testing: Verified directory exclusion logic and payload structure validation

Directory Structure Example

your-repo/
├── scripts/              # Regular Jamf Pro scripts
│   ├── install_app.sh
│   └── configure_system.py
└── extension-attributes/  # Extension attribute scripts  
    ├── check_app_version.sh
    └── get_system_info.py

The implementation maintains full backward compatibility while adding powerful new functionality for managing extension attribute scripts alongside regular scripts.

Fixes #10.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot avatar Sep 12 '25 04:09 Copilot

@jgarcesres 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot avatar Sep 12 '25 04:09 Copilot