From 118ed210ca97106a44aaa8c86d81316196532dc7 Mon Sep 17 00:00:00 2001 From: Kapakayala Naga sai krishna vinayswami <66941388+vinayswamik@users.noreply.github.com> Date: Tue, 26 Aug 2025 20:43:36 -0500 Subject: [PATCH 1/7] Add files via upload --- docs/_static/logo.png | Bin 154809 -> 154811 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/_static/logo.png b/docs/_static/logo.png index f41c51fc31fd28c8b0635001833a0dd19f9fd426..eaa9312e37fa17f1f3b9145f0855000be170cb10 100644 GIT binary patch delta 27 jcmdnFlXLe@PS(x Date: Wed, 27 Aug 2025 02:10:51 +0000 Subject: [PATCH 2/7] Feature: Add logo check workflow to prevent unauthorized changes --- .github/workflows/logo-check.yml | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/logo-check.yml diff --git a/.github/workflows/logo-check.yml b/.github/workflows/logo-check.yml new file mode 100644 index 00000000..8829f1e4 --- /dev/null +++ b/.github/workflows/logo-check.yml @@ -0,0 +1,62 @@ +name: Logo Check + +on: + pull_request_target: + branches: ['main'] + types: [opened, reopened, ready_for_review, synchronize] + +jobs: + check-logo-changes: + name: Check for Logo Changes + runs-on: ubuntu-latest + if: ${{ github.actor != 'dependabot' && github.actor != 'dependabot[bot]' && github.actor != 'github-actions' && github.actor != 'github-actions[bot]' && github.event.pull_request.draft == false }} + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Check for logo.png changes + run: | + # Get the list of changed files + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) + + # Check if logo.png is in the changed files + if echo "$CHANGED_FILES" | grep -q "docs/_static/logo.png"; then + echo "❌ ERROR: Changes to docs/_static/logo.png are not allowed!" + echo "The logo.png file is protected and cannot be modified through pull requests." + echo "If you need to update the logo, please contact the repository maintainers." + echo "" + echo "Changed files in this PR:" + echo "$CHANGED_FILES" + exit 1 + else + echo "✅ No changes detected to docs/_static/logo.png" + fi + + - name: Comment on PR if logo changes detected + if: failure() + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `🚫 **Logo Change Blocked** + + Changes to \`docs/_static/logo.png\` are not allowed in pull requests. + + **Why is this blocked?** + - The logo is a protected asset that should only be updated by repository maintainers + - This helps maintain brand consistency and prevents unauthorized logo changes + + **What should you do?** + - Remove the logo.png changes from this PR + - If you need to update the logo, please contact the repository maintainers directly + + **Files changed in this PR:** + \`\`\` + ${process.env.CHANGED_FILES || 'Unable to retrieve changed files'} + \`\`\`` + }) From da832488ae0034382404c0a38e5f61e7b169f32a Mon Sep 17 00:00:00 2001 From: TheGupta2012 Date: Thu, 28 Aug 2025 13:24:43 +0530 Subject: [PATCH 3/7] update docstr for loads to render kwargs as bullets --- src/pyqasm/entrypoint.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/pyqasm/entrypoint.py b/src/pyqasm/entrypoint.py index 6cd3e02b..a368ca34 100644 --- a/src/pyqasm/entrypoint.py +++ b/src/pyqasm/entrypoint.py @@ -57,13 +57,20 @@ def loads(program: openqasm3.ast.Program | str, **kwargs) -> QasmModule: program (openqasm3.ast.Program or str): The OpenQASM program to validate. **kwargs: Additional arguments to pass to the loads function. - device_qubits (int): Number of physical qubits available on the target device. - device_cycle_time (float): The duration of a hardware device cycle, in seconds. - compiler_angle_type_size (int): The width of the angle type in the compiler. - extern_functions (dict): Dictionary of extern functions to be added to the module. - frame_in_def_cal (bool): Whether to allow frames in defcal. - frame_limit_per_port (int): The maximum number of frames per port. - play_in_cal_block (bool): Whether to allow play in defcal. + + - **device_qubits** (int): Number of physical qubits available on the target device. + + - **device_cycle_time** (float): The duration of a hardware device cycle, in seconds. + + - **compiler_angle_type_size** (int): The width of the angle type in the compiler. + + - **extern_functions** (dict): Dictionary of extern functions to be added to the module. + + - **frame_in_def_cal** (bool): Whether to allow frames in defcal. + + - **frame_limit_per_port** (int): The maximum number of frames per port. + + - **play_in_cal_block** (bool): Whether to allow play in defcal. Raises: TypeError: If the input is not a string or an `openqasm3.ast.Program` instance. From 1d2632275dfaf34815e2a6394cae75ab373b1591 Mon Sep 17 00:00:00 2001 From: Kapakayala Naga sai krishna vinayswami <66941388+vinayswamik@users.noreply.github.com> Date: Thu, 28 Aug 2025 12:03:51 -0500 Subject: [PATCH 4/7] Update logo-check.yml --- .github/workflows/logo-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/logo-check.yml b/.github/workflows/logo-check.yml index 8829f1e4..ab50b30f 100644 --- a/.github/workflows/logo-check.yml +++ b/.github/workflows/logo-check.yml @@ -2,7 +2,7 @@ name: Logo Check on: pull_request_target: - branches: ['main'] + branches: ['*'] types: [opened, reopened, ready_for_review, synchronize] jobs: From 65a46ec74e465bdfdb8d3b5ebaa3260ebfb07985 Mon Sep 17 00:00:00 2001 From: Kapakayala Naga sai krishna vinayswami <66941388+vinayswamik@users.noreply.github.com> Date: Thu, 28 Aug 2025 14:14:36 -0500 Subject: [PATCH 5/7] Update logo-check.yml --- .github/workflows/logo-check.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/logo-check.yml b/.github/workflows/logo-check.yml index ab50b30f..e166ed90 100644 --- a/.github/workflows/logo-check.yml +++ b/.github/workflows/logo-check.yml @@ -17,9 +17,13 @@ jobs: fetch-depth: 0 - name: Check for logo.png changes + id : logo_check run: | # Get the list of changed files CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) + echo "changed_files<> $GITHUB_OUTPUT + echo "$CHANGED_FILES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT # Check if logo.png is in the changed files if echo "$CHANGED_FILES" | grep -q "docs/_static/logo.png"; then @@ -57,6 +61,9 @@ jobs: **Files changed in this PR:** \`\`\` - ${process.env.CHANGED_FILES || 'Unable to retrieve changed files'} + ${process.env.INPUT_CHANGED_FILES || 'Unable to retrieve changed files'} \`\`\`` }) + env: + INPUT_CHANGED_FILES: ${{ steps.logo_check.outputs.changed_files }} + From 2f944b1c903f5df2e8ee10d6e1c3ba5e7cae3c31 Mon Sep 17 00:00:00 2001 From: TheGupta2012 Date: Mon, 1 Sep 2025 12:33:40 +0530 Subject: [PATCH 6/7] update pr target --- .github/workflows/logo-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/logo-check.yml b/.github/workflows/logo-check.yml index e166ed90..57273ab5 100644 --- a/.github/workflows/logo-check.yml +++ b/.github/workflows/logo-check.yml @@ -2,7 +2,7 @@ name: Logo Check on: pull_request_target: - branches: ['*'] + branches: ['main'] types: [opened, reopened, ready_for_review, synchronize] jobs: From 46ea78eb5a538b45bc85adf37fb2df2283f41133 Mon Sep 17 00:00:00 2001 From: TheGupta2012 Date: Mon, 1 Sep 2025 12:39:35 +0530 Subject: [PATCH 7/7] add changelog [no ci] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a59d336..32b02650 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Types of changes: saturation_pulse $0; } ``` +- Added a workflow to track changes in the `docs/_static/logo.png` file to prevent unnecessary modifications. ([#257](https://github.com/qBraid/pyqasm/pull/257)) ### Improved / Modified - Modified if statement validation to now include empty blocks as well. See [Issue #246](https://github.com/qBraid/pyqasm/issues/246) for details. ([#251](https://github.com/qBraid/pyqasm/pull/251))