Skip to content

Commit e37b821

Browse files
committed
WIP
1 parent 8c5b8fa commit e37b821

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/rustc-pull.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: rustc-pull
22

33
on:
4+
pull_request:
45
workflow_dispatch:
56
schedule:
67
# Run at 04:00 UTC every Monday
@@ -10,6 +11,8 @@ jobs:
1011
pull:
1112
if: github.repository == 'rust-lang/rustc-dev-guide'
1213
runs-on: ubuntu-latest
14+
outputs:
15+
message: ${{ steps.update-pr.outputs.message }}
1316
permissions:
1417
contents: write
1518
pull-requests: write
@@ -40,6 +43,7 @@ jobs:
4043
git switch -c $BRANCH
4144
git push -u origin $BRANCH --force
4245
- name: Create pull request
46+
id: update-pr
4347
run: |
4448
# Check if an open pull request for an rustc pull update already exists
4549
# If it does, the previous push has just updated it
@@ -53,3 +57,40 @@ jobs:
5357
fi
5458
env:
5559
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
base:
61+
runs-on: ubuntu-latest
62+
outputs:
63+
message: ${{ steps.update-pr.outputs.message }}
64+
steps:
65+
- name: Step 1
66+
run: exit 1
67+
- name: Update PR
68+
id: update-pr
69+
run: echo "message=M1" >> "$GITHUB_OUTPUT"
70+
send-zulip-message:
71+
needs: [base]
72+
if: ${{ !cancelled() }}
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Compute message
76+
id: message
77+
run: |
78+
if [ "${{ needs.base.result }}" == "failure" ];
79+
then
80+
MESSAGE="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
81+
echo "message=Rustc pull sync has failed. Check out the [workflow URL]($MESSAGE)." >> $GITHUB_OUTPUT;
82+
else
83+
echo "message=FOO" >> $GITHUB_OUTPUT;
84+
fi
85+
- name: Print message
86+
run: echo "${{ steps.message.outputs.message }}"
87+
# - name: Send a Zulip message about updated PR
88+
# uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
89+
# with:
90+
# api-key: ${{ secrets.ZULIP_API_TOKEN }}
91+
92+
# organization-url: "https://rust-lang.zulipchat.com"
93+
# to: 196385
94+
# type: "stream"
95+
# topic: "Subtree sync automation"
96+
# content: ${{ steps.message.outputs.message }}

0 commit comments

Comments
 (0)