File: label_issues.sh

package info (click to toggle)
aws-crt-python 0.24.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 75,932 kB
  • sloc: ansic: 418,984; python: 23,626; makefile: 6,035; sh: 4,075; ruby: 208; java: 82; perl: 73; cpp: 25; xml: 11
file content (52 lines) | stat: -rwxr-xr-x 1,049 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -eu

update_label() {
# $1 is a username
USER=$1
# $2 is a cutoff date; use $(date +%Y-%m-%d) for now
DATE=$2

  gh api -X GET search/issues -f q="repo:aws/s2n-tls is:open -label:s2n-core author:${USER} created:<${DATE}" > ${USER}.json
  jq  -c -r '.items|.[]|.number' $USER.json > ${USER}_ISSUES.log
  if [ $(cat ${USER}_ISSUES.log|wc -l) -eq 0 ]; then
    echo "No issues for ${USER}"
    return
  fi
  echo "Found $(cat ${USER}_ISSUES.log|wc -l) issues for $USER, continue?"
  read
  for issue in $(cat ${USER}_ISSUES.log); do
    echo "Updating $issue"
    echo '["s2n-core"]'| gh api --silent -X POST repos/aws/s2n-tls/issues/$issue/labels --input -
  done
  echo "Done with $USER"
}

internal="toidiu
zaherd
NLMalloy
ttjsu-aws
rday
agray256
tawdry-audrey
salusasecondus
dougch
lrstewart
goatgoose
camshaft
maddeleine
WesleyRosenblum"

maint="colmmacc
alexw91
baldwinmatt
soco
alexeblee"

for USER in ${internal}; do
  update_label ${USER} $(date +%Y-%m-%d)
done

for USER in ${maint}; do
  update_label ${USER} 2019-10-23
done