on: workflow_call: inputs: release_prefix: required: true type: string release_branch: required: false default: main type: string develop_branch: required: false default: develop type: string sync_pr_label: required: false default: bumpless type: string secrets: USER_TOKEN: required: true jobs: write-release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: fetch-depth: 0 token: ${{ secrets.USER_TOKEN }} - name: Create Release uses: docker://antonyurchenko/git-release:v3.5.0 env: GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} RELEASE_NAME_PREFIX: "${{ inputs.release_prefix }} " ALLOW_TAG_PREFIX: true - name: Attempt fast-forward develop from release run: | git fetch --prune git checkout ${{ inputs.develop_branch }} && git pull --ff-only git merge --ff-only origin/${{ inputs.release_branch }} git push - name: On failure, open PR to bring release back to develop if: ${{ failure() }} env: PR_TITLE: Pulling ${{ github.ref }} into ${{ inputs.develop_branch }} PR_BODY: Fast-forward of ${{ inputs.release_branch }} to ${{ inputs.develop_branch }} failed! GH_TOKEN: ${{ secrets.USER_TOKEN }} run: | gh pr create --title "${PR_TITLE}" \ --body "${PR_BODY}" \ --assignee ${{ github.actor }} \ --label ${{ inputs.sync_pr_label }} \ --head ${{ inputs.release_branch }} \ --base ${{ inputs.develop_branch }}