forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.86 KB
/
bump-tempo.yml
File metadata and controls
59 lines (50 loc) · 1.86 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
58
59
name: Bump Tempo Dependencies
permissions: {}
on:
schedule:
# Run daily at 00:00 UTC
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
bump-tempo:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Bump tempo dependencies
id: bump
env:
GH_TOKEN: ${{ github.token }}
run: ./.github/scripts/bump-tempo.sh
- name: Create Pull Request
if: steps.bump.outputs.updated == 'true'
env:
GH_TOKEN: ${{ github.token }}
LATEST_REV: ${{ steps.bump.outputs.latest_rev }}
CHANGELOG_FILE: ${{ steps.bump.outputs.changelog }}
run: |
BRANCH_NAME="deps/bump-tempo-${LATEST_REV:0:7}"
# Skip if a PR already exists for this branch
EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --state open --json number --jq '.[0].number')
if [[ -n "$EXISTING_PR" ]]; then
echo "PR #${EXISTING_PR} already exists for ${BRANCH_NAME}, skipping."
exit 0
fi
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Create and push branch (force-push in case a stale branch exists from a prior failed run)
git checkout -b "$BRANCH_NAME"
git add Cargo.toml Cargo.lock
git commit -m "chore(deps): bump tempo dependencies to ${LATEST_REV:0:7}"
git push --force-with-lease origin "$BRANCH_NAME"
# Create PR
gh pr create \
--title "chore(deps): bump tempo dependencies to ${LATEST_REV:0:7}" \
--body-file "$CHANGELOG_FILE" \
--base main \
--head "$BRANCH_NAME"