-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (51 loc) · 1.76 KB
/
cargo-update.yml
File metadata and controls
57 lines (51 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
name: Update Deps
on:
workflow_dispatch:
# Run every Monday at 0530 UTC
schedule:
- cron: '30 5 * * 1'
jobs:
cargo-update:
name: Update dependencies
runs-on: ubuntu-latest
env:
UPDATE_BRANCH_NAME: auto-cargo-update
steps:
- name: Checkout the repo
uses: actions/checkout@v6
- name: Cargo update
run: cargo update
- name: Commit changes
id: commit
# There may not be any updates to commit/push
continue-on-error: true
run: |
git config user.name 'phylum-bot'
git config user.email '69485888+phylum-bot@users.noreply.github.com'
git commit -a -m "Bump dependencies"
git push --force origin HEAD:${{ env.UPDATE_BRANCH_NAME }}
- name: Create Pull Request
id: pr
if: ${{ steps.commit.outcome == 'success' }}
# The PR may already exist (e.g., created in previous week and not merged yet) so we
# allow it here and check in the next step so workflow failures will be extraordinary
continue-on-error: true
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GH_RELEASE_PAT }}
script: |
const response = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: "${{ env.UPDATE_BRANCH_NAME }}",
base: context.ref,
title: "Bump dependencies",
body: "Bump dependencies for all SemVer-compatible updates.",
});
console.log(response);
- name: Verify PR exists
if: ${{ steps.pr.outcome == 'failue' }}
env:
GH_TOKEN: ${{ github.token }}
run: gh pr view ${{ env.UPDATE_BRANCH_NAME }}