Skip initial build and post PR preview comments#17
Conversation
This commit updates the `build-release.yml` workflow so that it skips the initial commit by adding a new `eval` job to the workflow which evaluates the workflow preconditions. This is done since the initial commit will only contain the template document, so is not a meaningful release. The workflow will also fail for the initial commit, since the initial commit message won't conform to the conventional commits specification until the `create-from-template.yml` workflow runs. Fixes #16.
This commit adds more detail to the script outputs of the workflows within this repo. Currently this is just done with `echo`. Since all of the workflows are fairly simple, there isn't much need for the grouped log lines or `debug`/`info`/`warning` message etc. Fixes #11.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the GitHub Actions workflows to skip builds on initial commits and provide PR preview functionality. The main purpose is to improve the workflow experience when creating repositories from the template and reviewing pull requests.
Key changes:
- Build releases are now skipped on the initial commit to avoid publishing the template document
- PR comments now include preview builds of the PDF and changelog for easier review
- Build preparation logic has been extracted into a reusable workflow for better code organization
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| front_matter/document_revision.tex | Updated version number in document history |
| .github/workflows/pull-request.yml | Added preview build and comment posting functionality |
| .github/workflows/prep-build.yml | New reusable workflow for build preparation |
| .github/workflows/lint-commits.yml | Added descriptive output messages to bash commands |
| .github/workflows/create-from-template.yml | Added descriptive output messages to bash commands |
| .github/workflows/build-release.yml | Refactored to use reusable prep workflow and skip initial commits |
| .github/workflows/build-latex.yml | Enhanced with checkout parameters and artifact URL output |
| .github/workflows/README.md | Updated documentation for new workflows and changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This commit adds new functionality to the workflows to post a preview build of the document, along with the proposed changelog, as a comment on any opened PRs. To facilitate this, I've moved the original `prep` stage from `.github/workflows/build-release.yml` into a new reusable workflow; `.github/workflows/prep-build.yml`. This allows it to be shared between the release build and PR preview builds. I've also updated the way the checkout steps work for building the document and generating the changelog to try and ensure that they will work for PRs opened from forks. Fixes #7.
This commit bumps the document revision from `v0.1.1` to `v0.1.2`. I've decided to just edit the existing version, since nothing in the document has actually changed, and the entry is for example only.
Document Preview[0.1.2] - 2025-11-13🛠️ CI/CD |
2fa1501 to
06e5ebd
Compare
|
Triggered from #17 by @NathanielJS1541. Checking if we can fast forward Target branch ( commit 2e2bb098320fed43545c930d8931dbb74f34d8df (HEAD -> main, tag: v0.1.1, origin/main)
Author: Nathaniel Struselis <[email protected]>
Date: Mon Nov 3 04:50:09 2025 +0000
chore(release): bump example document version
This commit bumps the document revision from `v0.1.0` to `v0.1.1`. I've
decided to just edit the existing version, since nothing in the document
has actually changed, and the entry is for example only.Pull request ( commit 06e5ebdf74c4ce414c57a31371dc178f4d2964cc (pull_request/fix/skip_initial_commit_build)
Author: Nathaniel Struselis <[email protected]>
Date: Thu Nov 13 16:09:50 2025 +0000
chore(release): bump example document version
This commit bumps the document revision from `v0.1.1` to `v0.1.2`. I've
decided to just edit the existing version, since nothing in the document
has actually changed, and the entry is for example only.It is possible to fast forward |
|
/fast-forward |
This PR adds the following functionality to the workflows in this repo:
build-release.ymlworkflow will now skip when reun on the initial commit of a repo. This is done for two reasons:create-from-template.ymlworkflow rebases the initial commit to conform to the conventional commits specification, but this is done after the initial push. So the first run will fail anyway since the initial commit message will beInitial commit, which is not conventional.pull-request.ymlworkflow will now post a preview build of the.pdfand changelog as a comment on PRs. This comment will be updated whenever new changes are pushed to the PR branch.I've also moved the
prepjob from thebuild-release.ymlworkflow into a reusable workflow (prep-build.yml) so it chan be shared betweenbuild-release.ymlandpull-request.yml.