Skip to content

Commit

Permalink
Update "Bump CUDA-Q commit" workflow to accept any branch name. (#75)
Browse files Browse the repository at this point in the history
This will be useful for targeted testing of specific feature branches or large PRs.

---------

Signed-off-by: Ben Howe <bhowe@nvidia.com>
  • Loading branch information
bmhowe23 authored Feb 7, 2025
1 parent 2d31c43 commit de09379
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/update-cudaq-dep.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
on:
workflow_dispatch:
inputs:
cudaq_branch_name:
type: string
required: true
description: 'Branch name for upstream CUDA-Q repo (e.g. main or pull-request/2407)'
default: main

schedule:
- cron: 0 1 * * 6

Expand All @@ -22,7 +29,7 @@ jobs:

- name: Fetch the latest commit
run: |
SHA=$(curl -s "https://api.github.com/repos/NVIDIA/cuda-quantum/commits/main" | jq -r '.sha')
SHA=$(curl -s "https://api.github.com/repos/NVIDIA/cuda-quantum/commits/${{ inputs.cudaq_branch_name }}" | jq -r '.sha')
echo "Latest SHA: $SHA"
echo "sha=$SHA" >> $GITHUB_ENV
Expand Down Expand Up @@ -64,8 +71,13 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
BRANCH_NAME: ${{ steps.commit_and_push.outputs.BRANCH_NAME }}
run: |
if [[ "${{ inputs.cudaq_branch_name }}" == "main" ]]; then
TITLE_STR="Bump CUDA-Q commit"
else
TITLE_STR="Bump CUDA-Q commit (${{ inputs.cudaq_branch_name }} DO NOT MERGE)"
fi
gh pr create \
--title "Bump CUDA-Q commit" \
--body "Auto update to the latest CUDA-Q commit" \
--title "${TITLE_STR}" \
--body "Auto update to the latest CUDA-Q commit on ${{ inputs.cudaq_branch_name }} branch" \
--head "${BRANCH_NAME}" \
--base "main"

0 comments on commit de09379

Please sign in to comment.