Skip to content

Commit

Permalink
slack example
Browse files Browse the repository at this point in the history
  • Loading branch information
austenstone committed Oct 6, 2023
1 parent 9c697b5 commit 54c179d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/usage-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Cleanup 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@v3
- uses: ./
with:
github-token: ${{ secrets.TOKEN }}
organization: "octodemo"
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/slack-github-action@v1.24.0
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 }}

0 comments on commit 54c179d

Please sign in to comment.