{"id":22882522,"url":"https://github.com/cqcl/hugrverse-actions","last_synced_at":"2025-05-08T03:06:36.526Z","repository":{"id":248143964,"uuid":"827863186","full_name":"CQCL/hugrverse-actions","owner":"CQCL","description":"Reusable worflows for projects in the hugrverse","archived":false,"fork":false,"pushed_at":"2025-05-07T12:20:54.000Z","size":64,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-08T03:06:33.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CQCL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-12T14:40:26.000Z","updated_at":"2025-05-07T12:20:57.000Z","dependencies_parsed_at":"2024-07-12T17:52:27.961Z","dependency_job_id":"d3972b1b-a686-465b-8176-c917cdc858e6","html_url":"https://github.com/CQCL/hugrverse-actions","commit_stats":null,"previous_names":["cqcl/hugrverse-actions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fhugrverse-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fhugrverse-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fhugrverse-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fhugrverse-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CQCL","download_url":"https://codeload.github.com/CQCL/hugrverse-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252989949,"owners_count":21836667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T18:18:06.866Z","updated_at":"2025-05-08T03:06:36.518Z","avatar_url":"https://github.com/CQCL.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# hugrverse-actions\n\nReusable workflows for projects in the hugrverse.\n\nTo call use workflow in your project, add it to a workflow in your project's `.github/workflows` directory.\nSee the workflow list below for usage instructions, including the workflow triggers.\n\nSome workflows may require additional inputs, such as a [`GITHUB_PAT`] to\naccess the GitHub API. For these we [generate fine-grained access\ntokens](https://github.com/settings/personal-access-tokens/new) with the\n@hugrbot bot account, which must be stored in the repository secrets.\n\nThe following workflows are available:\n\n- [`add-to-project`](#add-to-project): Adds new issues to a GitHub project board when they are created.\n- [`breaking-change-to-main`](#breaking-change-to-main): Checks for breaking changes targeting a protected branch (by default `main`) and disallows them when a separate release branch is specified.\n- [`coverage-trend`](#coverage-trend): Checks the coverage trend for the project, and produces a summary that can be posted to slack.\n- [`create-issue`](#create-issue): Creates a new issue in the repository, avoiding duplicates.\n- [`drop-cache`](#drop-cache): Drops the cache for a branch when a pull request is closed.\n- [`pr-title`](#pr-title): Checks the title of pull requests to ensure they follow the conventional commits format.\n- [`rs-semver-checks`](#rs-semver-checks): Runs `cargo-semver-checks` on a PR against the base branch, and reports back if there are breaking changes.\n- [`slack-notifier`](#slack-notifier): Post comments on slack, with a rate limit to avoid spamming the channel.\n\n## [`add-to-project`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/add-to-project.yml)\n\nAdds new issues to a GitHub project board when they are created.\n\n### Usage\n```yaml\nname: Add issues to project board\non:\n  issues:\n    types:\n      - opened\n\njobs:\n    add-to-project:\n        uses: CQCL/hugrverse-actions/.github/workflows/add-to-project.yml@main\n        with:\n            project-url: https://github.com/orgs/{your-org}/projects/{project-id}\n        secrets:\n            GITHUB_PAT: ${{ secrets.ADD_TO_PROJECT_PAT }}\n```\n\n### Token Permissions\n\nThe fine-grained `GITHUB_PAT` secret must include the following permissions:\n\n| Permission | Access |\n| --- | --- |\n| Projects | Read and write |\n| Pull requests | Read |\n\nThe fine-grained access token **must** be defined in the organization that owns the project. This may require a different token from the one used in other workflows.\n\nIf the repository is private and the project is in a different organization, it is not possible to define fine-grained access tokens with simultaneous access to both. In those cases, you will need an unrestricted _classical_ github token instead.\n\n## [`breaking-change-to-main`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/breaking-change-to-main.yml)\n\nChecks for breaking changes targeting `protected_branch` (by default `main`) and\ndisallows them when a separate `release_branch` is specified. This is useful to\nprevent accidental breaking changes from being merged into `protected_branch`,\nwhen non-breaking patch releases are still expected to be published before the\nnext breaking release.\n\nBy default, the `release_branch` is set to the `protected_branch`, and in this\ncase, the workflow will be a no-op.\n\n### Usage\n```yaml\nname: Check for breaking changes targeting main\non:\n  pull_request_target:\n    branches:\n      - main\n    types:\n      - opened\n      - edited\n      - synchronize\n      - labeled\n      - unlabeled\n  merge_group:\n    types: [checks_requested]\n\njobs:\n    breaking-change-to-main:\n        uses: CQCL/hugrverse-actions/.github/workflows/breaking-change-to-main.yml@main\n        secrets:\n            GITHUB_PAT: ${{ secrets.GITHUB_PAT }}\n        with:\n            # The dedicated release branch, or the main branch if none exists.\n            # Typically, this will be a [repo variable](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables).\n            # Defaults to the same value as protected_branch.\n            release_branch: release-branch\n            # The protected branch, typically main (default) or master.\n            protected_branch: main\n```\n\n### Token Permissions\n\nThe fine-grained `GITHUB_PAT` secret must include the following permissions:\n\n| Permission | Access |\n| --- | --- |\n| Pull requests | Read and write |\n\n## [`coverage-trend`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/coverage-trend.yml)\n\nCompares the project coverage on [Codecov](https://codecov.io/) against the last workflow run,\nand produces a summary of the changes that can be posted to slack.\n\nIf the project didn't have new commits that changed the coverage since the last run,\nthe `should_notify` output will be set to `false` and the `msg` output will be empty.\n\n### Usage\n```yaml\nname: Notify coverage changes\non:\n  schedule:\n    # 04:00 every Monday\n    - cron: '0 4 * * 1'\n  workflow_dispatch: {}\n\njobs:\n    coverage-trend:\n        uses: CQCL/hugrverse-actions/.github/workflows/coverage-trend.yml@main\n        secrets:\n            CODECOV_GET_TOKEN: ${{ secrets.CODECOV_GET_TOKEN }}\n    # Post the result somewhere.\n    notify-slack:\n      needs: coverage-trend\n      runs-on: ubuntu-latest\n      if: needs.coverage-trend.outputs.should_notify == 'true'\n      steps:\n        - name: Send notification\n          uses: slackapi/slack-github-action@v1.27.0\n          with:\n            channel-id: \"SOME CHANNEL ID\"\n            slack-message: ${{ needs.coverage-trend.outputs.msg }}\n          env:\n            SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}\n```\n\n### Outputs\n\n- `should_notify`: Whether there has been a change in coverage since the last run, which we can post about.\n- `msg`: A message summarising the coverage changes. This is intended to be posted to slack.\n\n### Token Permissions\n\n`CODECOV_GET_TOKEN` is a token generated by Codecov to access the repository's coverage data.\n\n## [`drop-cache`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/drop-cache.yml)\n\nDrops the cache for a branch when a pull request is closed. This helps to avoid\ncache pollution by freeing up some of github's limited cache space.\n\n### Usage\n```yaml\nname: cleanup caches by a branch\non:\n  pull_request:\n    types:\n      - closed\n\njobs:\n    drop-cache:\n        uses: CQCL/hugrverse-actions/.github/workflows/drop-cache.yml@main\n```\n\n## [`create-issue`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/create-issue.yml)\n\nCreates a new issue in the repository, avoiding duplicates.\nThe workflow takes a \"unique-label\" input, which is used to check if an issue with that label already exists.\n\nThe specified labels must already exist in the repository, otherwise the workflow will fail.\n\n### Usage\n```yaml\nname: Create an issue\non:\n  schedule:\n    # 12:00 every Monday\n    - cron: '0 12 * * 1'\n\njobs:\n    create-issue:\n        uses: CQCL/hugrverse-actions/.github/workflows/create-issue.yml@main\n        secrets:\n            GITHUB_PAT: ${{ secrets.GITHUB_PAT }}\n        with:\n            title: \"Hello 🌎!\"\n            body: \"This is a new issue.\"\n            unique-label: \"hello-world\"\n            # Optionally, set the target repository.\n            repository: \"CQCL/hugrverse-actions\"\n            # Optional list of labels to add to the issue.\n            other-labels: \"greetings,scheduled\"\n```\n\n### Token Permissions\n\nThe fine-grained `GITHUB_PAT` secret must include the following permissions:\n\n| Permission | Access |\n| --- | --- |\n| Issues | Read and write |\n\n\n## [`pr-title`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/pr-title.yml)\n\nChecks the title of pull requests to ensure they follow the [conventional\ncommits](https://www.conventionalcommits.org/en/v1.0.0/) format. If the title\ndoes not follow the conventional commits, a comment is posted on the PR to help\nthe user fix it.\n\n### Usage\n```yaml\nname: Check Conventional Commits format\non:\n  pull_request_target:\n    branches:\n      - main\n    types:\n      - opened\n      - edited\n      - synchronize\n      - labeled\n      - unlabeled\n  merge_group:\n    types: [checks_requested]\n\njobs:\n    check-title:\n        uses: CQCL/hugrverse-actions/.github/workflows/pr-title.yml@main\n        secrets:\n            GITHUB_PAT: ${{ secrets.GITHUB_PAT }}\n```\n\n### Token Permissions\n\nThe fine-grained `GITHUB_PAT` secret must include the following permissions:\n\n| Permission | Access |\n| --- | --- |\n| Pull requests | Read and write |\n\n## [`rs-semver-checks`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/rs-semver-checks.yml)\n\nRuns `cargo-semver-checks` on a PR against the base branch, and reports back if\nthere are breaking changes.\nSuggests adding a breaking change flag to the PR title if necessary. \n\n### Usage\n```yaml\nname: Rust Semver Checks\non:\n  pull_request_target:\n    branches:\n      - main\n\njobs:\n    rs-semver-checks:\n        uses: CQCL/hugrverse-actions/.github/workflows/rs-semver-checks.yml@main\n        secrets:\n            GITHUB_PAT: ${{ secrets.GITHUB_PAT }}\n```\n\nThe workflow compares against the base branch of the PR by default. Use the `baseline-rev` input to specify a different base commit.\n\n### Token Permissions\n\nThe fine-grained `GITHUB_PAT` secret must include the following permissions:\n\n| Permission | Access |\n| --- | --- |\n| Pull requests | Read and write |\n\nNote that repository secrets are not available to forked repositories on `pull_request` events.\nTo run this workflow on pull requests from forks, ensure the action is triggered by a `pull_request_target` event instead.\n\n## [`slack-notifier`](https://github.com/CQCL/hugrverse-actions/blob/main/.github/workflows/slack-notifier.yml)\n\nPost comments on slack using\n[slackapi/slack-github-action](https://github.com/slackapi/slack-github-action),\nadding a rate limit to avoid spamming the channel.\n\n### Usage\n```yaml\nname: Send a slack message\non:\n  pull_request:\n    branches:\n      - main\n\njobs:\n    message-slack:\n        uses: CQCL/hugrverse-actions/.github/workflows/slack-notifier.yml@main\n        with:\n            channel-id: \"SOME CHANNEL ID\"\n            slack-message: \"Hello 🌎!\"\n            # A minimum time in minutes to wait before sending another message.\n            timeout-minutes: 60\n            # A repository variable used to store the last message timestamp.\n            timeout-variable: \"HELLO_MESSAGE_TIMESTAMP\"\n        secrets:\n            GITHUB_PAT: ${{ secrets.GITHUB_PAT }}\n            SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}\n```\n\n### Inputs\n\n- `channel-id`: The ID of the channel to post the message to. (**required**)\n- `slack-message`: The message to post. (**required**)\n- `timeout-variable`: A repository variable used to store the last message timestamp. (**required**)\n- `timeout-minutes`: A minimum time in minutes to wait before sending another message. Defaults to 24 hours.\n\n### Outputs\n\n- `sent`: A boolean indicating if the message was sent.\n\n### Token Permissions\n\n`SLACK_BOT_TOKEN` is a token generated by Slack with `chat:write` access to the\nchannel. See the\n[slackapi/slack-github-action](https://github.com/slackapi/slack-github-action?tab=readme-ov-file#technique-2-slack-app)\ndocumentation for more information.\nIf you are using a slack app, make sure to add it to the channel.\nSee formatting options in the [Slack API documentation](https://api.slack.com/reference/surfaces/formatting).\n\nThe fine-grained `GITHUB_PAT` secret must include the following permissions:\n\n| Permission | Access |\n| --- | --- |\n| Variables (repository) | Read and write |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqcl%2Fhugrverse-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcqcl%2Fhugrverse-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqcl%2Fhugrverse-actions/lists"}