Skip to content

Change to test upstreaming workflow #23

Change to test upstreaming workflow

Change to test upstreaming workflow #23

name: ROCm Open Upstream PR
on:
pull_request:
types: [ labeled ]
branches: [ rocm-main ]
jobs:
open-upstream:
if: ${{ github.event.label.name == 'open-upstream' }}
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
new-pr-link: ${{ steps.create-pr.outputs.link }}
env:
NEW_BRANCH_NAME: "${{ github.head_ref }}-upstream"
NEW_PR_TITLE: "[ROCM] ${{ github.event.pull_request.title }}"
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Rebase code to main
run: |
git checkout -b $NEW_BRANCH_NAME ${{ github.head_ref }}
git rebase --onto main
git push origin HEAD
# TODO: Change the base of the PR to upstream main
- name: Create a PR to upstream
id: create-pr
run: |
echo link=$(gh pr create --repo rocm/jax --base main --head $NEW_BRANCH_NAME --title "$NEW_PR_TITLE" --body "${{ github.event.pull_request.body }}") >> "$GITHUB_OUTPUT"
comment-link:
needs: open-upstream
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Leave comment on old PR
run: gh pr comment ${{ github.event.pull_request.number }} --repo rocm/jax --body ${{ needs.open-upstream.outputs.new-pr-link.link }}