-
Notifications
You must be signed in to change notification settings - Fork 4
update notes on script update with timestamp #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
| 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") |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
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.
| 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") |
action.py
Outdated
| return False | ||
|
|
||
|
|
||
| #function to create a creation note with timestamp |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
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.'
| #function to create a creation note with timestamp | |
| # Function to create a creation note with timestamp. |
| return f"created via github action on {timestamp}" | ||
|
|
||
|
|
||
| #function to create or update notes with proper timestamping |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
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.'
| #function to create or update notes with proper timestamping | |
| # Function to create or update notes with proper timestamping. |
| return '\n'.join(updated_lines) | ||
|
|
||
|
|
||
| #retrieves list of files given a folder path and the list of valid file extensions to look for |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
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.'
| #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. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Solves this issue #8