Skip to content

Commit 6c0ed19

Browse files
committed
Automatically creates PR when no_atomic_cas.rs needs to be updated
1 parent 7c3e45f commit 6c0ed19

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

.github/workflows/ci.yml

+27-4
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,40 @@ jobs:
231231
--features unstable --ignore-unknown-features
232232
233233
# When this job failed, run ci/no_atomic_cas.sh and commit result changes.
234-
# TODO(taiki-e): Ideally, this should be automated using a bot that creates
235-
# PR when failed, but there is no bandwidth to implement it
236-
# right now...
237234
codegen:
238235
runs-on: ubuntu-latest
236+
permissions:
237+
contents: write
238+
pull-requests: write
239239
steps:
240240
- uses: actions/checkout@v2
241241
- name: Install Rust
242242
run: rustup update nightly && rustup default nightly
243243
- run: ci/no_atomic_cas.sh
244-
- run: git diff --exit-code
244+
- run: git add -N . && git diff --exit-code
245+
if: github.event_name != 'schedule'
246+
- id: diff
247+
run: |
248+
git config user.name "Taiki Endo"
249+
git config user.email "[email protected]"
250+
git add -N .
251+
if ! git diff --exit-code; then
252+
git add .
253+
git commit -m "Update no_atomic_cas.rs"
254+
echo "::set-output name=success::false"
255+
fi
256+
if: github.event_name == 'schedule'
257+
- uses: peter-evans/create-pull-request@v3
258+
with:
259+
title: Update no_atomic_cas.rs
260+
body: |
261+
Auto-generated by [create-pull-request][1]
262+
[Please close and immediately reopen this pull request to run CI.][2]
263+
264+
[1]: https://github.com/peter-evans/create-pull-request
265+
[2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
266+
branch: update-no-atomic-cas-rs
267+
if: github.event_name == 'schedule' && steps.diff.outputs.success == 'false'
245268

246269
miri:
247270
name: cargo miri test

0 commit comments

Comments
 (0)