Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🛠 Tooling: Post release action doesn't work after initial release #1682

Closed
3 tasks done
johnnyreilly opened this issue Nov 9, 2024 · 11 comments · Fixed by #1750
Closed
3 tasks done

🛠 Tooling: Post release action doesn't work after initial release #1682

johnnyreilly opened this issue Nov 9, 2024 · 11 comments · Fixed by #1750
Labels
area: documentation Improvements or additions to docs area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(

Comments

@johnnyreilly
Copy link
Collaborator

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Consider this post-release GitHub Action: https://github.com/johnnyreilly/ado-npm-auth-lite/actions/workflows/post-release.yml

After the initial run all subsequent runs fail with this error:

Error: HttpError: Resource not accessible by integration
Error: Resource not accessible by integration

Is this a "me" thing? I don't think I've done anything to that and so I'm wondering if I've stumbled on somthing.

Here's the initial successful run: https://github.com/johnnyreilly/ado-npm-auth-lite/actions/runs/11732080037/job/32683543794

Additional Info

n/a

@johnnyreilly johnnyreilly added the area: tooling Managing the repository's maintenance label Nov 9, 2024
@JoshuaKGoldberg
Copy link
Owner

Blugh, release permissions. What a pain. This is something I've been procrastinating finding time to really dig into. #925 and #1045 are relevant here too. Up for figuring this out? 😄

@JoshuaKGoldberg JoshuaKGoldberg added area: documentation Improvements or additions to docs status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :( labels Nov 9, 2024
@johnnyreilly
Copy link
Collaborator Author

It's weird - if memory serves I followed the instructions for setting up tokens correctly. And it did work the first time. I might dig into it but tbh the post release workflow is "nice to have" stuff - I can live without it.

But back to my original question:

Is this a "me" thing? I don't think I've done anything to that and so I'm wondering if I've stumbled on somthing.

Are you finding the same issues on your post release workflows as well?

@JoshuaKGoldberg
Copy link
Owner

@all-contributors please add @johnnyreilly for tool.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

Copy link
Contributor

@JoshuaKGoldberg

I've put up a pull request to add @johnnyreilly! 🎉

JoshuaKGoldberg pushed a commit that referenced this issue Nov 11, 2024
Adds @johnnyreilly as a contributor for tool.

This was requested by JoshuaKGoldberg [in this
comment](#1682 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
@JoshuaKGoldberg
Copy link
Owner

Oh, sorry, missed this:

Are you finding the same issues on your post release workflows as well?

I haven't had this issue.

@johnnyreilly
Copy link
Collaborator Author

Interesting. I've created 2 projects with CTA in the last 3 months and they both have the issue. Mystery as to why though

@johnnyreilly
Copy link
Collaborator Author

Here's two examples of the initial release working on the first attempt but failing on the second:

@johnnyreilly
Copy link
Collaborator Author

johnnyreilly commented Dec 7, 2024

It looks that the post-release.yml file needs the following:

permissions:
  issues: write
  pull-requests: write

Thanks to @apexskier for the help!

As to the "succeeds first time, fails after that" he said:

That's expected on first release - the action doesn't do anything on first release so it can't 403. (originally intended because you can have a long backlog of affected issues/PRs and can have some issues due to the volume)

Take a look at https://github.com/johnnyreilly/azdo-npm-auth/actions/runs/12211680069/job/34069255562 to see the permissions approach working:

screenshot of github workflows

And look at the history of this action prior to the addition:

screenshot of github workflows

Should the following be added to the post-release.yml as standard?

permissions:
  issues: write
  pull-requests: write

Copy link

github-actions bot commented Dec 7, 2024

Uh oh! @johnnyreilly, the image you shared is missing helpful alt text. Check #1682 (comment).

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

@JoshuaKGoldberg
Copy link
Owner

permissions:
  issues: write
  pull-requests: write

Great, accepting PRs to have this in post-release.yml! ✨

Nice job on the investigation @johnnyreilly. It looks like it was a lot messier than it would have seemed at first.

JoshuaKGoldberg pushed a commit that referenced this issue Dec 7, 2024
<!-- 👋 Hi, thanks for sending a PR to create-typescript-app! 💖.
Please fill out all fields below and make sure each item is true and [x]
checked.
Otherwise we may not be able to review your PR. -->

## PR Checklist

- [x] Addresses an existing open issue: fixes #1682
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

<!-- Description of what is changed and how the code change does that.
-->
This PR applies the change suggested by @apexskier here to attempt to
fix post-release permissions:


apexskier/github-release-commenter#545 (comment)
Copy link

🎉 This is included in version v1.77.0 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation Improvements or additions to docs area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants