Skip to content

Commit

Permalink
👷 maven release create pr instead of push
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhir committed Jul 30, 2024
1 parent 0a085dd commit cc2a20d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,40 @@ jobs:
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "GitHub Actions"
mvn release:prepare -f ./pom.xml -B -DreleaseVersion=${{ inputs.release-version }} -DdevelopmentVersion=${{ inputs.next-version }}
mvn release:prepare -f ./pom.xml -B -DreleaseVersion=${{ inputs.release-version }} -DdevelopmentVersion=${{ inputs.next-version }} -DpushChanges=false
mvn release:perform -f ./pom.xml -Darguments="-Dmaven.deploy.skip=true"
- name: "Upload target artifacts"
uses: actions/upload-artifact@v4
with:
name: target
path: "**/target"
retention-days: 5
- name: Push changes to new branch
run: |
git checkout -b ${{ github.ref_name }}-version-bump
git push --force origin ${{ github.ref_name }}-version-bump
- name: Create pull request
uses: actions/github-script@v7
with:
script: |
const { repo, owner } = context.repo;
const pullResult = await github.rest.pulls.create({
title: 'chore: bump release version ${{ github.ref_name }}',
owner,
repo,
head: '${{ github.ref_name }}-version-bump',
base: '${{ github.ref_name }}',
body: [
'This PR is auto-generated'
].join('\n')
});
await github.rest.issues.addAssignees({
owner,
repo,
issue_number: pullResult.data.number,
assignees: ['${{ github.actor }}'],
});
console.log(`Pull Request created: ${pullResult.data.html_url}`);
build-images:
if: inputs.build-images == true
Expand Down

0 comments on commit cc2a20d

Please sign in to comment.