Notify Inactive Copilot Licenses #396
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notify Inactive Copilot Licenses | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
copilot: | |
name: Copilot Seats | |
runs-on: ubuntu-latest | |
outputs: | |
inactive-seats: ${{ steps.copilot.outputs.inactive-seats }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
github-token: ${{ secrets.TOKEN }} | |
organization: 'myorg' | |
inactive-days: 30 | |
csv: true | |
notify-inactive: | |
name: Notify Inactive Users | |
runs-on: ubuntu-latest | |
needs: copilot | |
strategy: | |
matrix: | |
user: ${{ fromJson(needs.copilot.outputs.inactive-seats) }} | |
steps: | |
- uses: slackapi/[email protected] | |
with: | |
channel-id: 'CHANNEL_ID,ANOTHER_CHANNEL_ID' | |
slack-message: 'Hey <@${{ matrix.user }}>, you have not used Copilot for 30 days. Please contact your manager to free up your seat.' | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |