-
Notifications
You must be signed in to change notification settings - Fork 44
68 lines (61 loc) · 3.67 KB
/
upstream-tracker.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: UpstreamTracker
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1' # check monday at midnight UTC
jobs:
Solana-Update-Checker:
runs-on: ubuntu-latest
steps:
- name: Check For Updates In Past Week
id: updates
run: |
# new PRs
OPEN=$(curl https://api.github.com/repos/solana-foundation/solana-improvement-documents/pulls\?state=open\&per_page=100 | jq --arg t "$(date -d '7 days ago' +%s)" -r '.[] | select (.created_at | . == null or fromdateiso8601 > ($t|tonumber)) | "- \(.html_url)"')
# macos
# OPEN=$(curl https://api.github.com/repos/solana-foundation/solana-improvement-documents/pulls\?state\=open\&per_page\=100 | jq --arg t "$(date -v-7d +%s)" -r '.[] | select (.created_at | . == null or fromdateiso8601 > ($t|tonumber)) | "- \(.html_url)"')
# closed PRs
CLOSED=$(curl https://api.github.com/repos/solana-foundation/solana-improvement-documents/pulls\?state=closed\&per_page=100 | jq --arg t "$(date -d '7 days ago' +%s)" -r '.[] | select (.closed_at | . == null or fromdateiso8601 > ($t|tonumber)) | "- \(.html_url)"')
# macos
# CLOSED=$(curl https://api.github.com/repos/solana-foundation/solana-improvement-documents/pulls\?state\=closed\&per_page\=100 | jq --arg t "$(date -v-7d +%s)" -r '.[] | select (.created_at | . == null or fromdateiso8601 > ($t|tonumber)) | "- \(.html_url)"')
# updates to anza-xyz/agave wiki (contains feature gate updates + release schedules)
git clone https://github.com/anza-xyz/agave.wiki.git
cd agave.wiki
WIKILOGS="$(git log --since="7 days ago" --reverse --pretty=format:'{"commit":"%H","author":"%aN <%aE>","date":"%ad","message":"%f"}')"
WIKILOGS="[${WIKILOGS//$'\n'/,}]" # proper JSON formatting
WIKIRANGE="$(echo $WIKILOGS | jq -r '"\(.[0].commit)^..\(.[-1].commit)"')"
WIKI="$(git diff $WIKIRANGE)"
WIKI="${WIKI//$'\n'/\\n}" # preserve new line
printf -v WIKI "%q " "$WIKI" # escape chars that may cause issues
echo "open<<EOF" >> "$GITHUB_OUTPUT"
echo "$OPEN" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
echo "closed<<EOF" >> "$GITHUB_OUTPUT"
echo "$CLOSED" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
echo "wiki<<EOF" >> "$GITHUB_OUTPUT"
echo "$WIKI" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
echo "wikirange=$WIKIRANGE" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
if: steps.updates.outputs.open || steps.updates.outputs.closed || steps.updates.outputs.wiki
- name: Open Issue
if: steps.updates.outputs.open || steps.updates.outputs.closed || steps.updates.outputs.wiki
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TODO: update assignee to teams when GH supports it
run: |
{
echo "## SIMD";
echo "### Opened";
echo "${{ steps.updates.outputs.open }}";
echo "### Closed";
echo "${{ steps.updates.outputs.closed }}";
echo "## Agave Wiki";
echo "[${{ steps.updates.outputs.wikirange }}](https://github.com/anza-xyz/agave/wiki/_compare/${{steps.updates.outputs.wikirange }})";
echo "\`\`\`diff";
# shellcheck disable=SC1003
echo -e "${{ steps.updates.outputs.wiki }}" | tr -d '\'; # unescape + remove remaining backticks
echo "\`\`\`";
} >> output.md
gh issue create -a aalu1418 -t "Upstream Updates - $(date)" -l "AUTO: Upstream Updates" -F output.md