Skip to content

Conversation

@TomSweeneyRedHat
Copy link
Member

I was asked to create a GitHub action for the mono repo, and I thought I would create one that could be used for Buildah too. I don't think we will need this for container-libs after all, we'll just be tagging there I think.

So I have decided to add this here. I originally created https://github.com/TomSweeneyRedHat/ActionJackson/blob/main/.github/workflows/action_release.yml.finalhold which is based off the release GitHub action that Podman uses, but a little lighter weight. As Buildah doesn't use a RELEASE_NOTES.md like Podman does, I removed that logic from this version of the script.

This will create a Release when a tag is pushed upstream, and will generate the release notes in the same way that "Generate release notes" button on the GitHub web interface does, including recognizing new contributors. That is is I did the action correctly!

It also has the ability to be run fron the Actions menu, so if you ever want to redo a release, or test creating one without actually creating one, you can do so.

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

@TomSweeneyRedHat TomSweeneyRedHat added the No New Tests Allow PR to proceed without adding regression tests label Oct 17, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TomSweeneyRedHat

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@TomSweeneyRedHat
Copy link
Member Author

@ashley-cui PTAL

Comment on lines +107 to +110
- name: Checkout the main branch of this repository
uses: actions/checkout@v5
with:
ref: ${{needs.check.outputs.version}}
Copy link
Member

Choose a reason for hiding this comment

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

this is duplicated in the step below

Copy link
Member Author

Choose a reason for hiding this comment

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

Ouch, you're right!

Comment on lines +117 to +114
- name: Touch release notes file
run: |
touch $VERSION-release-notes.md
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need this if you're using the changelog action below

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't need it if they're generating the release note, but I do need it if they decide to pull the release notes from file instead.

contents: write # REQUIRED to create the release and fetch content
steps:
# ...
🧩 Key Actions Used (Inferred)
Copy link
Member

Choose a reason for hiding this comment

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

this is inside the code block, probably need to move it out

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed!

the "release" workflow in the left windowpane. Once selected, a new window will come up with a `Run workflow` button. Click on this, and answer
the following questions in the form:

* **Branch:** Select the branch of the project that you want to create the release from.
Copy link
Member

Choose a reason for hiding this comment

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

I think this is gone from the workflow

Copy link
Member Author

Choose a reason for hiding this comment

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

Cut/paste error, TY for picking that up, now gone.

Action Name Purpose
actions/checkout@v4 Downloads a copy of the repository code to the runner.
gableroux/[email protected] Generates the Markdown content for the release notes based on the commit history and merged PRs between tags.
softprops/action-gh-release@v1 Creates the final GitHub Release, publishing the generated notes using the pushed tag name.
Copy link
Member

Choose a reason for hiding this comment

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

This also looks wrong, we're using the gh CLI

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's gone, and I neglected to tweak checkout, which is not v5. Fixed.

Comment on lines 76 to 84
Export to Sheets
🛑 Troubleshooting
If the workflow fails with an error, such as the AxiosError: Request failed with status code 404 (a common GitHub API error in release actions), consider the following:

Check Permissions: Ensure your workflow or specific job has explicitly set permissions: contents: write to allow the default GITHUB_TOKEN to create the release.

Verify Tags: Confirm that the tag you pushed exactly matches the pattern the workflow is listening for (e.g., v*).

Previous Tag Existence: For release note generation to work correctly, a previous tag must exist to define the change range. Ensure your repository has at least one prior version tag.
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't apply, we guarantee buildah has prev versions :)

Copy link
Member Author

Choose a reason for hiding this comment

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

This I'm going to keep. We check for the previous version and it's not happy if it doesn't find it.

gableroux/[email protected] Generates the Markdown content for the release notes based on the commit history and merged PRs between tags.
softprops/action-gh-release@v1 Creates the final GitHub Release, publishing the generated notes using the pushed tag name.

Export to Sheets
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Export to Sheets

I was asked to create a GitHub action for the mono repo, and I thought
I would create one that could be used for Buildah too.  I don't think
we will need this for container-libs after all, we'll just be tagging
there I think.

So I have decided to add this here.  I originally created https://github.com/TomSweeneyRedHat/ActionJackson/blob/main/.github/workflows/action_release.yml.finalhold
which is based off the release GitHub action that Podman uses, but a
little lighter weight.  As Buildah doesn't use a RELEASE_NOTES.md like
Podman does, I removed that logic from this version of the script.

This will create a Release when a tag is pushed upstream, and will
generate the release notes in the same way that "Generate release notes"
button on the GitHub web interface does, including recognizing new
contributors.  That is is I did the action correctly!

It also has the ability to be run fron the Actions menu, so if you ever
want to redo a release, or test creating one without actually creating
one, you can do so.

Signed-off-by: tomsweeneyredhat <[email protected]>
@TomSweeneyRedHat
Copy link
Member Author

@ashley-cui PTA(nother)L. Thanks for the review, and I completely missed it.

@ashley-cui
Copy link
Member

LGTM! :)

@TomSweeneyRedHat
Copy link
Member Author

@containers/buildah-maintainers need some more loving on this one.


# If the job fails, permit the operator to observe the contents if helpful.
- name: Provide release e-mail contents for examination
run: cat email_body.txt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is email_body.txt file ? I cannot see it in this PR

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

Labels

approved No New Tests Allow PR to proceed without adding regression tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants