@@ -3,15 +3,16 @@ name: rustc-pull
3
3
on :
4
4
workflow_dispatch :
5
5
schedule :
6
- # Run at 04:00 UTC every Monday
7
- - cron : ' 0 4 * * 1 '
6
+ # Run at 04:00 UTC every day
7
+ - cron : ' 0 4 * * * '
8
8
9
9
jobs :
10
10
pull :
11
11
if : github.repository == 'rust-lang/rustc-dev-guide'
12
12
runs-on : ubuntu-latest
13
13
outputs :
14
14
pr_url : ${{ steps.update-pr.outputs.pr_url }}
15
+ pull_result : ${{ steps.rustc-pull.outputs.pull_result }}
15
16
permissions :
16
17
contents : write
17
18
pull-requests : write
34
35
git config --global user.name 'The rustc-dev-guide Cronjob Bot'
35
36
git config --global user.email '[email protected] '
36
37
- name : Perform rustc-pull
37
- run : cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull
38
+ id : rustc-pull
39
+ # Turn off -e to disable early exit
40
+ shell : bash {0}
41
+ run : |
42
+ cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull
43
+ exitcode=$?
44
+
45
+ if [ $exitcode -eq 2 ]; then
46
+ echo "pull_result=skipped" >> $GITHUB_OUTPUT
47
+ fi
48
+
49
+ exit ${exitcode}
38
50
- name : Push changes to a branch
39
51
run : |
40
52
# Update a sticky branch that is used only for rustc pulls
@@ -54,13 +66,14 @@ jobs:
54
66
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
55
67
else
56
68
PR_URL=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | .[0].url' --json url,title`
69
+ echo "Updating pull request ${PR_URL}"
57
70
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
58
71
fi
59
72
env :
60
73
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61
74
send-zulip-message :
62
75
needs : [pull]
63
- if : ${{ !cancelled() }}
76
+ if : ${{ !cancelled() && needs.pull.outputs.pull_result != 'skipped' }}
64
77
runs-on : ubuntu-latest
65
78
steps :
66
79
- name : Compute message
0 commit comments