forked from NixOS/nixpkgs-committers
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.32 KB
/
retire.yml
File metadata and controls
43 lines (39 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: retire
on:
schedule:
# Every day at 17:07 (randomly chosen)
- cron: '7 17 * * *'
# Allows manual trigger
workflow_dispatch:
permissions: {}
jobs:
retire:
name: retire
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Get GitHub App User Git String
id: user
run: |
userId=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)
name="${{ steps.app-token.outputs.app-slug }}[bot]"
email="$userId+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
git config --global user.name "$name"
git config --global user.email "$email"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Fetch source
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
# Fetch full history to determine when committers were added
fetch-depth: 0
- name: Run script
run: scripts/retire.sh NixOS nixpkgs nixpkgs-committers members "yesterday 1 month ago" "1 year ago"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PROD: "1"