generated from austenstone/action-typescript
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c697b5
commit 54c179d
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |