forked from gregkh/linux
-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (55 loc) · 3.24 KB
/
main.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
name: Sync
on:
schedule:
- cron: '57/30 * * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: 'write'
id-token: 'write'
env:
BUCKET_NAME: linux-mirror-db
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update mirror
run: |
git remote rename origin github
git remote add upstream https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux
git remote add -t master torvalds https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
git config branch.master.remote torvalds
git config branch.master.merge refs/heads/master
git config remote.upstream.pushurl $(git config remote.github.url)
git config remote.torvalds.pushurl $(git config remote.github.url)
git pull --all
git push -f github 'refs/remotes/upstream/*:refs/heads/*'
git push github 'refs/remotes/torvalds/master:refs/heads/master'
git push github --tags
- name: Create raw TSVs
run: |
git log --all --format=format:'%H%x09%(trailers:key=Fixes,separator=%x09,valueonly=true)' > ./fixes_raw.tsv
git log --all --format=format:'%H%x09%(trailers:key=Reported-by,separator=%x09,valueonly=true)' | grep syzkaller > ./reported_by_raw.tsv
git log --all --format=format:'%H%x09%(trailers:key=Reported-and-tested-by,separator=%x09,valueonly=true)' | grep syzkaller >> ./reported_by_raw.tsv
git log --all --format=format:'%H%x09%(trailers:key=Tested-by,separator=%x09,valueonly=true)' | grep syzkaller >> ./reported_by_raw.tsv
git name-rev --tags --all | sed s/\ /$'\t'/g > ./tags_raw.tsv
git log --all --all-match -E --grep='\b[0-9a-f]{40}\b' --grep=pstream | grep '[0-9a-f]\{40\}' | grep -i '^commit \|Upstream commit\|commit.*upstream' | sed 's/\(\s*\).*\([0-9a-f]\{40\}\).*/\1\2/' | sed ':a;N;$!ba;s/\n \+/\t/g' > ./upstream_raw.tsv
- name: Create valid CSVs
run: |
jq --raw-output --raw-input --slurp '["commit","fixes"],(.|split("\n")|.[]|split("\t")|.[0] as $commit|.[1:][]|[$commit,.])|@csv' ./fixes_raw.tsv > ./fixes.csv
jq --raw-output --raw-input --slurp '["commit","reported_by"],(.|split("\n")|.[]|split("\t")|.[0] as $commit|.[1:][]|select(contains("syzkaller"))|[$commit,.])|@csv' ./reported_by_raw.tsv > ./reported_by.csv
jq --raw-output --raw-input --slurp '["commit","tags"],(.|split("\n")|.[]|split("\t")|.[0] as $commit|.[1:][]|[$commit,.])|@csv' ./tags_raw.tsv > ./tags.csv
jq --raw-output --raw-input --slurp '["commit","upstream"],(.|split("\n")|.[]|split("\t")|.[0] as $commit|.[1:][]|[$commit,.])|@csv' ./upstream_raw.tsv > ./upstream.csv
- uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: 'projects/799795028847/locations/global/workloadIdentityPools/github-pool/providers/github-provider-new'
service_account: '[email protected]'
- uses: 'google-github-actions/upload-cloud-storage@v0'
with:
destination: '${{ env.BUCKET_NAME }}/'
path: ./
glob: '*.csv'
headers: |-
cache-control: no-cache