Skip to content

Conversation

@jgarcesres
Copy link
Owner

@jgarcesres jgarcesres commented Jul 29, 2025

Solves this issue #8

@jgarcesres jgarcesres linked an issue Jul 29, 2025 that may be closed by this pull request
@jgarcesres jgarcesres requested a review from Copilot July 29, 2025 16:43
Copy link

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 enhances the script management system by adding automatic timestamp tracking for creation and update operations in Jamf scripts. The changes implement a notes management system that preserves existing custom notes while maintaining clear tracking of when scripts were created or last updated via GitHub Actions.

  • Adds timestamped notes for script creation and updates
  • Implements logic to preserve existing custom notes while managing GitHub Action timestamps
  • Updates documentation to explain the new notes management behavior

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.

File Description
action.py Adds datetime import and two new functions for creating timestamped notes, plus integration into script creation/update workflow
README.md Updates documentation to explain the new notes management system and fixes a typo

action.py Outdated
Comment on lines 214 to 221
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S UTC")
return f"created via github action on {timestamp}"


#function to create or update notes with proper timestamping
@logger.catch
def update_script_notes(existing_notes, action_type="updated"):
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S UTC")
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

The timestamp format includes 'UTC' but datetime.now() returns local time, not UTC time. Use datetime.now(timezone.utc) or datetime.utcnow() to get actual UTC time.

Suggested change
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S UTC")
return f"created via github action on {timestamp}"
#function to create or update notes with proper timestamping
@logger.catch
def update_script_notes(existing_notes, action_type="updated"):
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S UTC")
timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")
return f"created via github action on {timestamp}"
#function to create or update notes with proper timestamping
@logger.catch
def update_script_notes(existing_notes, action_type="updated"):
timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")

Copilot uses AI. Check for mistakes.
action.py Outdated
return False


#function to create a creation note with timestamp
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

Comment should start with a capital letter and end with a period: 'Function to create a creation note with timestamp.'

Suggested change
#function to create a creation note with timestamp
# Function to create a creation note with timestamp.

Copilot uses AI. Check for mistakes.
return f"created via github action on {timestamp}"


#function to create or update notes with proper timestamping
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

Comment should start with a capital letter and end with a period: 'Function to create or update notes with proper timestamping.'

Suggested change
#function to create or update notes with proper timestamping
# Function to create or update notes with proper timestamping.

Copilot uses AI. Check for mistakes.
return '\n'.join(updated_lines)


#retrieves list of files given a folder path and the list of valid file extensions to look for
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

Comment should start with a capital letter and end with a period: 'Retrieves list of files given a folder path and the list of valid file extensions to look for.'

Suggested change
#retrieves list of files given a folder path and the list of valid file extensions to look for
# Retrieves list of files given a folder path and the list of valid file extensions to look for.

Copilot uses AI. Check for mistakes.
jgarcesres and others added 2 commits July 29, 2025 11:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jgarcesres jgarcesres self-assigned this Jul 29, 2025
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.

update script notes

2 participants