-
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.46 KB
/
version.yml
File metadata and controls
47 lines (38 loc) · 1.46 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
name: version
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Update OpenAPI Generator CLI version
id: version
run: python3 scripts/version.py
- name: Configure Git user
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Check for changes
if: steps.version.outputs.current_version != steps.version.outputs.latest_version
run: |
BRANCH="build/version-$LATEST_VERSION"
git checkout -B $BRANCH
git commit -am \
"build(deps): bump openapi-generator-cli from $CURRENT_VERSION to $LATEST_VERSION" \
-m "Release-As: $(cat version.txt | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.)" \
-m "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$LATEST_VERSION/"
git push --force origin $BRANCH
if ! gh pr view $BRANCH --json number >/dev/null 2>&1; then
gh pr create --assignee remarkablemark --fill --reviewer remarkablemark
fi
env:
GH_TOKEN: ${{ github.token }}
CURRENT_VERSION: ${{ steps.version.outputs.current_version }}
LATEST_VERSION: ${{ steps.version.outputs.latest_version }}