-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (45 loc) · 1.54 KB
/
update-version.yml
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
name: Update Version
on:
workflow_dispatch:
inputs:
version:
required: true
type: string
description: 'Besu version to be updated'
jobs:
update:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup branch name
id: branch
run: |
echo "BRANCH=update-${{ inputs.version }}-${{ github.run_number }}" >> "$GITHUB_OUTPUT"
- name: Update version
run: |
git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"
git checkout -b $BRANCH
bash updateBesu.sh ${{ inputs.version }}
git status -s | grep " M " | grep -q besu.rb || {
echo "No changes found in the besu.rb"
exit 1
}
git add besu.rb
git commit -s -m "Update Besu version ${{ inputs.version }}"
git push origin $BRANCH
env:
BRANCH: ${{ steps.branch.outputs.BRANCH }}
GIT_NAME: 'Besu Bot'
GIT_EMAIL: '[email protected]'
- name: Create Pull Request [permission needed]
run: |
gh pr create --base main --title "Update Besu version ${{ inputs.version }}" --body "Besu version update to ${{ inputs.version }}" || {
echo "Action does not have permission to create PRs. Ignoring..."
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}