File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 1818 - name : Checkout repository
1919 uses : actions/checkout@v2
2020
21- - name : Checkout metrics repository
22- uses : actions/checkout@v2
23- with :
24- repository : " rust-analyzer/metrics"
25- path : " target/metrics"
26-
2721 - name : Install Rust toolchain
2822 uses : actions-rs/toolchain@v1
2923 with :
3529 - name : Collect metrics
3630 run : cargo xtask metrics
3731 env :
38- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32+ METRICS_TOKEN : ${{ secrets.METRICS_TOKEN }}
Original file line number Diff line number Diff line change @@ -17,17 +17,17 @@ pub fn run_metrics() -> Result<()> {
1717 metrics. measure_build ( ) ?;
1818
1919 {
20- let _d = pushd ( "target/metrics" ) ;
20+ let _d = pushd ( "target" ) ;
21+ let api_token = env:: var ( "METRICS_TOKEN" ) . unwrap ( ) ;
22+ let repo = format ! ( "https://{}@github.com/rust-analyzer/metrics.git" , api_token) ;
23+ run ! ( "git clone --depth 1 {}" , repo) ?;
24+ let _d = pushd ( "metrics" ) ;
25+
2126 let mut file = std:: fs:: OpenOptions :: new ( ) . append ( true ) . open ( "metrics.json" ) ?;
2227 writeln ! ( file, "{}" , metrics. json( ) ) ?;
2328 run ! ( "git add ." ) ?;
2429 run ! ( "git -c user.name=Bot -c [email protected] commit --message 📈" ) ?
; 25-
26- if let Ok ( actor) = env:: var ( "GITHUB_ACTOR" ) {
27- let token = env:: var ( "GITHUB_TOKEN" ) . unwrap ( ) ;
28- let repo = format ! ( "https://{}:{}@github.com/rust-analyzer/metrics.git" , actor, token) ;
29- run ! ( "git push {}" , repo) ?;
30- }
30+ run ! ( "git push origin master" ) ?;
3131 }
3232 eprintln ! ( "{:#?}\n " , metrics) ;
3333 eprintln ! ( "{}" , metrics. json( ) ) ;
You can’t perform that action at this time.
0 commit comments