Skip to content

Skip initial build and post PR preview comments#17

Merged
NathanielJS1541 merged 4 commits intomainfrom
fix/skip_initial_commit_build
Nov 13, 2025
Merged

Skip initial build and post PR preview comments#17
NathanielJS1541 merged 4 commits intomainfrom
fix/skip_initial_commit_build

Conversation

@NathanielJS1541
Copy link
Owner

This PR adds the following functionality to the workflows in this repo:

  • The build-release.yml workflow will now skip when reun on the initial commit of a repo. This is done for two reasons:
    • When consuming the template, the only document contents at the initial commit will be the template document, which will not be a meaningful release to have on the repo.
    • The create-from-template.yml workflow 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 be Initial commit, which is not conventional.
  • More detail has been added to workflow outputs to hopefully make them clearer, especially the incline bash scripts.
  • The pull-request.yml workflow will now post a preview build of the .pdf and 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 prep job from the build-release.yml workflow into a reusable workflow (prep-build.yml) so it chan be shared between build-release.yml and pull-request.yml.

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.
@NathanielJS1541 NathanielJS1541 self-assigned this Nov 13, 2025
Copilot AI review requested due to automatic review settings November 13, 2025 16:19
@NathanielJS1541 NathanielJS1541 added ✨ enhancement New feature or request 🎬 action Changes to the GitHub Actions labels Nov 13, 2025
@github-actions

This comment was marked as outdated.

Copy link

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 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.
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Document Preview

Download PDF Preview

[0.1.2] - 2025-11-13

🛠️ CI/CD

  • Skip build workflow on initial commit #16
  • Add more detail to workflow outputs #11
  • Post preview document and changelog on PRs #7

@NathanielJS1541 NathanielJS1541 force-pushed the fix/skip_initial_commit_build branch from 2fa1501 to 06e5ebd Compare November 13, 2025 16:24
@github-actions
Copy link

Triggered from #17 by @​NathanielJS1541.

Checking if we can fast forward main (2e2bb09) to fix/skip_initial_commit_build (06e5ebd).

Target branch (main):

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 (fix/skip_initial_commit_build):

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 main (2e2bb09) to fix/skip_initial_commit_build (06e5ebd). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to fix/skip_initial_commit_build.

@NathanielJS1541
Copy link
Owner Author

/fast-forward

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

Labels

🎬 action Changes to the GitHub Actions ✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants