Some organizations need to keep track of their site inventory in an external system, like ServiceNow, and this script will utilize the Github Actions cron scheduler to regularly fetch site inventory through Terminus for an organization, combine those into a JSON file, and email it to an end user or system.
- Terminus Machine Token
- Pantheon Organization ID
- SendGrid API Key
- Mail Recipient (who is recieving)
- Mail User (who is sending)
- Checkout git repo
- Install PHP
- Install Composer dependencies
- Authenticate with Terminus
- Run Site Inventory Script
- Get the list of sites in the organization
- Get the list of users in the organization
- Loop through the sites, and replace the user UUID with their email
- Encode data in a JSON file
- Email JSON file to defined recipient