Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/logo-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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
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<<EOF" >> $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
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.INPUT_CHANGED_FILES || 'Unable to retrieve changed files'}
\`\`\``
})
env:
INPUT_CHANGED_FILES: ${{ steps.logo_check.outputs.changed_files }}

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Binary file modified docs/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 14 additions & 7 deletions src/pyqasm/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down