Skip to content

Comments

chore: switch autopub workflows to action#861

Open
bellini666 wants to merge 3 commits intomainfrom
autpub-action
Open

chore: switch autopub workflows to action#861
bellini666 wants to merge 3 commits intomainfrom
autpub-action

Conversation

@bellini666
Copy link
Member

@bellini666 bellini666 commented Feb 17, 2026

Summary

  • replace direct autopub binary calls with autopub-action steps
  • rely on action-managed .autopub artifacts and keep PR check fail-on-missing
  • add contents write permission for release publish

Summary by Sourcery

Switch GitHub release and PR workflows to use the autopub GitHub Action instead of direct autopub CLI invocations.

CI:

  • Replace manual autopub CLI steps in release and PR workflows with autopub/autopub-action commands for check, prepare, build, and publish.
  • Rely on action-managed .autopub artifacts and keep PR checks failing on missing release metadata.
  • Grant contents: write permission in the release workflow to allow the action to publish releases.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 17, 2026

Reviewer's Guide

Switches GitHub release and PR workflows from directly invoking the autopub CLI via uv to using the official autopub GitHub Action, removes manual .autopub artifact handling, and adjusts permissions and outputs accordingly.

File-Level Changes

Change Details Files
Replace manual autopub CLI invocations with autopub/autopub-action steps in the release workflow.
  • Remove uv installation and shell-based autopub check logic, including manual has_release output handling and .autopub directory verification and artifact upload.
  • Use autopub/autopub-action@v1 with command=check and github-token input to set has-release output, updating output wiring and debug logging to the new output name.
  • Split the previous combined build-and-publish shell step into distinct Prepare, Build, and Publish steps backed by autopub/autopub-action@v1 with appropriate command inputs and git/GitHub credentials.
.github/workflows/release.yml
Adjust workflow permissions to support action-based publishing.
  • Add contents: write to workflow permissions to allow the action to push release-related changes or tags.
.github/workflows/release.yml
Update PR workflow to use autopub/autopub-action for release checks with fail-fast behavior on missing artifacts.
  • Remove uv installation, manual autopub check shell logic, .autopub directory verification, and artifact upload steps.
  • Introduce autopub/autopub-action@v1 with command=check, github-token, and fail-on-missing set to true to retain failing behavior on missing release metadata for pull_request_target events.
.github/workflows/pr.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@botberry
Copy link
Member

botberry commented Feb 17, 2026

Hi, thanks for contributing to this project!

We noticed that this PR is missing a RELEASE.md file. We use that to automatically do releases here on GitHub and, most importantly, to PyPI!

So as soon as this PR is merged, a release will be made 🚀.

Here's an example of RELEASE.md:

---
release type: patch
---

Description of the changes, ideally with some examples, if adding a new feature.

Release type can be one of patch, minor or major. We use [semver](https://semver.org/), so make sure to pick the appropriate type. If in doubt feel free to ask :)

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The output name change from has_release to has-release in release.yml may break any other workflows or jobs that reference needs.release.outputs.has_release; consider keeping the original output name or adding a compatibility output if anything external depends on it.
  • In pr.yml, the fail-on-missing input is passed as a quoted string ("true"); if the action expects a boolean input, switching to an unquoted true would better align with typical GitHub Actions input conventions and avoid potential type issues.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The output name change from `has_release` to `has-release` in `release.yml` may break any other workflows or jobs that reference `needs.release.outputs.has_release`; consider keeping the original output name or adding a compatibility output if anything external depends on it.
- In `pr.yml`, the `fail-on-missing` input is passed as a quoted string (`"true"`); if the action expects a boolean input, switching to an unquoted `true` would better align with typical GitHub Actions input conventions and avoid potential type issues.

## Individual Comments

### Comment 1
<location> `.github/workflows/pr.yml:29-33` </location>
<code_context>
-      - name: Upload .autopub artifact
-        if: steps.check.outputs.has_release == 'true'
-        uses: actions/upload-artifact@v4
+        uses: autopub/autopub-action@v1
         with:
-          name: autopub-data
-          path: .autopub
-          include-hidden-files: true
+          command: check
+          github-token: ${{ secrets.BOT_TOKEN }}
+          fail-on-missing: "true"
</code_context>

<issue_to_address>
**question (bug_risk):** Double‑check that always failing when no release is found matches the previous behavior across all triggers

Previously, the shell script only exited non‑zero for `pull_request_target` events. With `fail-on-missing: "true"`, failure now depends solely on the action and is no longer event‑type dependent, so other triggers could start failing where they didn’t before. To keep behavior aligned, either restrict this step with an `if: github.event_name == 'pull_request_target'` or confirm the workflow never runs for other event types.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.37%. Comparing base (655d39f) to head (7761646).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #861   +/-   ##
=======================================
  Coverage   91.37%   91.37%           
=======================================
  Files          45       45           
  Lines        4419     4419           
=======================================
  Hits         4038     4038           
  Misses        381      381           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository’s GitHub Actions workflows to use autopub/autopub-action@v1 instead of invoking the AutoPub CLI directly, and adjusts permissions needed for publishing releases.

Changes:

  • Replace AutoPub CLI (uvx autopub ...) steps with autopub/autopub-action@v1 commands in release and PR workflows
  • Add contents: write permission to enable release publishing
  • Minor CHANGELOG line numbering fix

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
CHANGELOG.md Fixes a missing line number in the changelog list.
.github/workflows/release.yml Switches release workflow steps to autopub/autopub-action@v1 and adds contents: write permission.
.github/workflows/pr.yml Switches PR “check for release” step to autopub/autopub-action@v1 with fail-on-missing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants