12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- name: Reusable - Create operator pull request
- on:
- workflow_call:
- inputs:
- version:
- type: string
- required: true
- secrets:
- BOT_TOKEN:
- required: true
- # to help with partial release build failures
- workflow_dispatch:
- inputs:
- version:
- description: "Version"
- required: true
- jobs:
- create-operator-pull-request:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- repository: opentelemetrybot/opentelemetry-operator
- # this is the personal access token used for "git push" below
- token: ${{ secrets.BOT_TOKEN }}
- - name: Initialize pull request branch
- env:
- VERSION: ${{ inputs.version }}
- run: |
- git remote add upstream https://github.com/open-telemetry/opentelemetry-operator.git
- git fetch upstream
- git checkout -b update-opentelemetry-javaagent-to-${VERSION} upstream/main
- - name: Update version
- env:
- VERSION: ${{ inputs.version }}
- run: |
- echo $VERSION > autoinstrumentation/java/version.txt
- - name: Use CLA approved github bot
- run: |
- # cannot run the use-cla-approved-github-bot.sh script here since in a different repo
- git config user.name opentelemetrybot
- git config user.email 107717825+opentelemetrybot@users.noreply.github.com
- - name: Create pull request against opentelemetry-operator
- env:
- # this is the personal access token used for "gh pr create" below
- GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
- VERSION: ${{ inputs.version }}
- run: |
- message="Update the javaagent version to $VERSION"
- # note that @open-telemetry/java-instrumentation-approvers cannot be used below
- # because opentelemetrybot is not a member of the OpenTelemetry org,
- # and so it cannot @ mention OpenTelemetry org groups
- body="Update the javaagent version to \`$VERSION\`.
- cc @laurit @mateuszrzeszutek @trask
- "
- # gh pr create doesn't have a way to explicitly specify different head and base
- # repositories currently, but it will implicitly pick up the head from a different
- # repository if you set up a tracking branch
- git commit -a -m "$message"
- git push --set-upstream origin HEAD:update-opentelemetry-javaagent-to-${VERSION}
- gh pr create --title "$message" \
- --body "$body" \
- --repo open-telemetry/opentelemetry-operator \
- --base main
|