forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 2.16 KB
/
version_bumps.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
51
52
53
54
55
56
57
58
59
60
name: Bump dependencies
on:
workflow_dispatch:
inputs:
branch:
description: 'Release Branch'
required: true
default: '8.4'
type: string
bump:
description: 'Bump type'
required: true
default: 'patch'
type: choice
options:
- "patch"
- "minor"
- "major"
permissions:
pull-requests: write
contents: write
jobs:
version_bumper:
name: Bump versions
runs-on: ubuntu-latest
steps:
- name: Fetch logstash-core team member list
uses: tspascoal/get-user-teams-membership@v1
with:
username: ${{ github.actor }}
organization: elastic
team: logstash
GITHUB_TOKEN: ${{ secrets.READ_ORG_SECRET_JSVD }}
- name: Is user a core team member?
if: ${{ steps.checkUserMember.outputs.isTeamMember == 'false' }}
run: exit 1
- name: checkout repo content
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "logstashmachine"
- run: ./gradlew clean installDefaultGems
- run: ./vendor/jruby/bin/jruby -S bundle update --all --${{ github.event.inputs.bump }} --strict
- run: mv Gemfile.lock Gemfile.jruby-*.lock.release
- run: echo "T=$(date +%s)" >> $GITHUB_ENV
- run: echo "BRANCH=update_lock_${T}" >> $GITHUB_ENV
- run: |
git checkout -b $BRANCH
git add .
git status
if [[ -z $(git status --porcelain) ]]; then echo "No changes. We're done."; exit 0; fi
git commit -m "Update ${{ github.event.inputs.bump }} plugin versions in gemfile lock" -a
git push origin $BRANCH
- name: Create Pull Request
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d "{\"title\": \"bump lock file for ${{ github.event.inputs.branch }}\",\"head\": \"${BRANCH}\",\"base\": \"${{ github.event.inputs.branch }}\"}" https://api.github.com/repos/elastic/logstash/pulls