Skip to content

Module examle

Module examle #25

name: PostUpgradeTask
on:
workflow_dispatch:
pull_request_target:
types: [ opened, reopened ]
branches:
- 'master'
jobs:
postupgradetask:
if: ${{ startsWith(github.head_ref, 'renovate/') }}
runs-on: ubuntu-latest
steps:
- name: Echo github.head_ref
run: echo ${{ github.head_ref }}
- name: Parse branch name
id: parse
env:
BRANCH: ${{ github.head_ref }}
run: |
GROUPID=$(echo $BRANCH | cut -d'/' -f2 | cut -d'-' -f1)
GROUPID=$(echo "${GROUPID^}")
echo "GROUPID=$GROUPID" >> "$GITHUB_OUTPUT"
- name: echo parsed values
env:
GROUPID: ${{ steps.parse.outputs.GROUPID }}
run: echo "groupId=${GROUPID}"
- uses: actions/checkout@v3
name: checkout
with:
ref: master
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Upgrade
env:
NEW_VERSION: ${{ steps.parse.outputs.NEW_VERSION }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GROUPID: ${{ steps.parse.outputs.GROUPID }}
run: |
ls -al
java --version
mvn --version
echo "TODO: call openrewrite recipe"
mvn rewrite:run -Drecipe=com.gepardec.update.${GROUPID} -Popenrewrite -s .m2/settings.xml
# - name: Create Pull Request
# uses: peter-evans/create-pull-request@v6
# with:
# token: ${{ secrets.RENOVATE_TOKEN }}
# title: Upgrade quarkus from ${{ steps.parse.outputs.CURR_VERSION }} to ${{ steps.parse.outputs.NEW_VERSION }}
# branch: postupgradetask/${{ steps.parse.outputs.DEPNAME }}_${{ steps.parse.outputs.CURR_VERSION }}_${{ steps.parse.outputs.NEW_VERSION }}
# base: master
# committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
# body: |
# Upgrade quarkus version