Sync #24785
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
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 | |