Skip to content

Commit

Permalink
Set some params as optinal
Browse files Browse the repository at this point in the history
  • Loading branch information
luongvo committed Nov 24, 2023
1 parent f95ef04 commit 6c87df5
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions create_release_pr/action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
name: Automate creating the Release pull request
description: Automate creating the Release pull request
inputs:
token:
description: The GitHub PAT for this action to use
required: true
version:
description: Current release version
required: true
token:
description: The GitHub PAT for this action to use
required: false
default: ${{ github.token }}
base_branch:
description: The base branch for the release pull request, e.g., "main"
required: true
required: false
default: main
changelogConfiguration:
description: The changelog configuration file path, e.g., ".github/workflows/config/changelog-release.json"
required: true
assignee:
description: The assignee username for the Release pull request, e.g. bot-nimble
required: true
description: The assignee for the Release pull request, e.g., bot-nimble
required: false
default: 'bot-nimble'
label:
description: The label for the Release pull request, e.g. "type : release"
required: true
description: 'The label for the Release pull request, e.g., "type : release"'
required: false
default: 'type : release'

runs:
using: composite
Expand All @@ -42,24 +46,24 @@ runs:
GH_TOKEN: ${{ inputs.token }}
shell: bash
run: |
HEAD_BRANCH=release/${{ inputs.version }}
RELEASE_BRANCH=release/${{ inputs.version }}
# Fetch milestone info
gh extension install valeriobelli/gh-milestone
MILESTONE=${{ inputs.version }}
MILESTONE_URL=$(gh milestone list --query $MILESTONE --json url --jq ".[0].url")
# Create the release branch
git checkout -b $HEAD_BRANCH
git push origin $HEAD_BRANCH -f
git checkout -b $RELEASE_BRANCH
git push origin $RELEASE_BRANCH -f
# Create the pull request
gh pr create \
--base ${{ inputs.base_branch }} \
--head $HEAD_BRANCH \
--head $RELEASE_BRANCH \
--assignee ${{ inputs.assignee }} \
--title "Release - ${{ inputs.version }}" \
--label ${{ inputs.label }} \
--label "${{ inputs.label }}" \
--milestone $MILESTONE \
--body "$MILESTONE_URL
Expand Down

0 comments on commit 6c87df5

Please sign in to comment.