You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
support parsing git tags for document status (#73)
This change updates --gitstatus to parse the document status at revision 0 based on the first letter of the tag. It also causes everything after revision 0 to be considered a draft. Also, if revision is 0, it's not included in the document metadata (so the final document just has a Version).
In the GitHub action YAML, you can enable some advanced features.
756
+
757
+
## Git Version Parsing
758
+
759
+
Use `extra-build-options: "--gitversion"` to let Git number the document for you.
760
+
761
+
```yaml
762
+
- name: Run the action
763
+
uses: trustedcomputinggroup/markdown@latest
764
+
with:
765
+
extra-build-options: "--gitversion"
766
+
```
767
+
768
+
When you do this, the tool will check for a recent [release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) in the repository. It will use the major.minor
769
+
version number from the tag as the document version, and the number of commits since that tag as the revision.
770
+
This way, you don't have to manually update the version or revision numbers in your document!
771
+
772
+
### Conventions for Release Naming
773
+
774
+
The tooling expects the following conventions for tagging your releases:
775
+
776
+
* `vX.Y` indicates a regular draft of version X.Y.
777
+
* `rX.Y` indicates a review draft of version X.Y.
778
+
* `pX.Y` indicates a published version.
779
+
780
+
## Git Status Parsing
781
+
782
+
Use `extra-build-options: "--gitstatus"` to let Git number AND set the status of the document for you.
783
+
784
+
```yaml
785
+
- name: Run the action
786
+
uses: trustedcomputinggroup/markdown@latest
787
+
with:
788
+
extra-build-options: "--gitstatus"
789
+
```
790
+
791
+
See [Conventions](#conventions-for-release-naming). When `--gitstatus` is enabled, the leading character
792
+
(which is expected to be one of: `v`, `r`, or `p`) is used to determine the document's status at
793
+
revision 0. Commits on top of any type of version are always considered to be drafts.
794
+
795
+
## Running Pandoc with Releases
796
+
797
+
@sec:basic-gh-action shows an example of a GitHub action that automatically runs Pandoc on every
798
+
pull request and push to the repository.
799
+
800
+
You may wish to run the workflow on releases, and attach the results to the release page, for
801
+
example to have it generate a docx file to send to the Technical Committee for review, or when
802
+
publishing a final version of a document.
803
+
804
+
Use the example below as a guide for how you can have Pandoc automatically render the doc
805
+
(maybe basing its [status](#git-status-parsing) on the released tag).
\textit{This document is an intermediate draft for comment only and is subject to change without notice. Readers should not design products based on this document.}
0 commit comments