From b2fcff59c7cc98d4935d624e39c3fab37398e3cc Mon Sep 17 00:00:00 2001 From: Jiri Jaburek Date: Mon, 15 Apr 2024 18:58:12 +0200 Subject: [PATCH] change CONTEST_CONTENT_LATEST to CONTEST_CONTENT_BRANCH This is to more closely match the openscap variables. Signed-off-by: Jiri Jaburek --- README.md | 14 ++++++-------- plans/main.fmf | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d3a5a530..de73ee33 100644 --- a/README.md +++ b/README.md @@ -75,11 +75,11 @@ on Red Hat Enterprise Linux. content. - Note that this may fail if the content is located on a read-only path. -- `CONTEST_CONTENT_LATEST` - - Set to `1` to use latest content available in the +- `CONTEST_CONTENT_BRANCH` + - Specify a branch name of the [CaC/content](https://github.com/ComplianceAsCode/content/) project. - - This will download content from the default branch and automatically pre-set - `CONTEST_CONTENT` to point to it. + - This will download content from the specified branch and automatically + pre-set `CONTEST_CONTENT` to point to it. - Essentially, this is like `CONTEST_CONTENT` but without you having to provide a cloned directory, Contest automatically clones it for you. - Do not specify `CONTEST_CONTENT` in combination with this option. @@ -87,10 +87,8 @@ on Red Hat Enterprise Linux. - `CONTEST_CONTENT_PR` - Specify a numerical Pull Request ID (no `#` or other letters) of the [CaC/content](https://github.com/ComplianceAsCode/content/) project. - - This will download content from the specified PR and automatically pre-set - `CONTEST_CONTENT` to point to it. - - This is like `CONTEST_CONTENT_LATEST`, but instead of using the default - branch, it checks out repository contents specific to the pull request. + - This is like `CONTEST_CONTENT_BRANCH`, but it uses content from the + pull request instead of a branch. - Do not specify `CONTEST_CONTENT` in combination with this option. - `CONTEST_OSCAP_BRANCH` diff --git a/plans/main.fmf b/plans/main.fmf index 084b7db3..b28d69c5 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -31,8 +31,8 @@ adjust: name: Download and build latest or pull request content script: | set -xe - if [ -n "$CONTEST_CONTENT_LATEST" ]; then - ref=HEAD + if [ -n "$CONTEST_CONTENT_BRANCH" ]; then + ref="refs/heads/$CONTEST_CONTENT_BRANCH" elif [ -n "$CONTEST_CONTENT_PR" ]; then ref="refs/pull/$CONTEST_CONTENT_PR/head" else