From ad4a9b337c9fe8c8a8e1756bff78bb752ff585c7 Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Wed, 2 Apr 2025 19:30:09 -0400 Subject: [PATCH 1/7] ci: add action that always merge the release branch to master --- .github/workflows/merge-release-to-master.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/merge-release-to-master.yml diff --git a/.github/workflows/merge-release-to-master.yml b/.github/workflows/merge-release-to-master.yml new file mode 100644 index 0000000..e5de9d0 --- /dev/null +++ b/.github/workflows/merge-release-to-master.yml @@ -0,0 +1,27 @@ +name: Merge Release to Master + +on: + push: + branches: + - 'release' + +jobs: + merge-release-to-master: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email "github-actions@github.com" + + - name: Merge Release into Master + run: | + git checkout master + git merge --no-ff release -m "Merge release branch into master" + git push origin master From 04378640c2214706acf5e97c591665573bc257b4 Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Wed, 2 Apr 2025 19:30:23 -0400 Subject: [PATCH 2/7] docs: update the documentation --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b8e2bfd..a2ba85e 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,17 @@ jobs: 1. Fork the repository 2. Create a feature branch: `git checkout -b my-new-feature` 3. Commit your changes using [Conventional Commits](https://www.conventionalcommits.org/): - - `feat: add new feature` - - `fix: fix a bug` - - `docs: update documentation` - - `chore: maintenance tasks` + - `feat`: add a new feature (MINOR release) + - `fix`: fix a bug (PATCH release) + - `docs`: documentation changes only + - `style`: changes that don't affect code meaning (formatting, whitespace) + - `refactor`: code change that neither fixes a bug nor adds a feature + - `perf`: performance improvements + - `test`: adding or updating tests + - `build`: changes to build system or dependencies + - `ci`: changes to CI configuration + - `chore`: other changes that don't modify src or test files + - Adding `BREAKING CHANGE:` to the footer triggers a MAJOR release 4. Push to the branch: `git push origin my-new-feature` 5. Submit a pull request @@ -63,11 +70,11 @@ Releases are automatically created when commits are merged to the `release` bran - `fix:` commits trigger a PATCH release (1.0.x) - `feat:` commits trigger a MINOR release (1.x.0) -- `feat!:` or `fix!:` or any commit with `BREAKING CHANGE:` in the footer triggers a MAJOR release (x.0.0) +- Any commit with `BREAKING CHANGE:` in the footer triggers a MAJOR release (x.0.0) ## Authors -- Vicente Bolea @ Kitware +- Vicente Bolea ## License From 51f300cc37b887b89cf658543c0465b65c41b25b Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Mon, 7 Apr 2025 19:13:09 -0400 Subject: [PATCH 3/7] chore: change urls to kitware --- README.md | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a2ba85e..4ecd484 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ A GitHub Action that sets CDash status for your commits. -[![Release](https://img.shields.io/github/v/release/vicentebolea/cdash-status)](https://github.com/vicentebolea/cdash-status/releases) +[![Release](https://img.shields.io/github/v/release/Kitware/cdash-status)](https://github.com/Kitware/cdash-status/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) ## Usage ```yaml -- uses: vicentebolea/cdash-status@v1 +- uses: Kitware/cdash-status@v1 with: project: "MyProject" ``` @@ -39,7 +39,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: CDash Status - uses: vicentebolea/cdash-status@v1 + uses: Kitware/cdash-status@v1 with: project: "MyProject" ``` diff --git a/package.json b/package.json index 33afc58..e4c11f9 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "repository": { "type": "git", - "url": "https://github.com/vicentebolea/cdash-status.git" + "url": "https://github.com/kitware/cdash-status.git" }, "keywords": [ "cdash", From 2b4fda5e5204a4463936ccb05b7448ee39fef840 Mon Sep 17 00:00:00 2001 From: Tim Haines Date: Fri, 24 Jul 2026 12:24:33 -0500 Subject: [PATCH 4/7] Improve error handling in post-cdash-status --- post-cdash-status | 52 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/post-cdash-status b/post-cdash-status index 85ae473..c472aea 100755 --- a/post-cdash-status +++ b/post-cdash-status @@ -1,7 +1,5 @@ #!/bin/bash -set -eo pipefail - readonly API_BASE="https://api.github.com/repos/${GITHUB_REPOSITORY}" function require_cmd() { @@ -28,12 +26,27 @@ require_env_var "GITHUB_TOKEN" #============================================================================== -statuses=$(curl -q -s \ - -H "Content-Type: application/json" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "${API_BASE}/commits/${COMMIT_SHA}/statuses" |\ - jq -r '[.[].context] | @json') +readonly status_response=$( + curl -q -s \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Content-Type: application/json" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "${API_BASE}/commits/${COMMIT_SHA}/statuses") + +# The API returns an empty array if no statuses were found +# This can happen if the COMMIT_SHA doesn't point to the head of the branch/PR +if [ "true" == $(jq -r '. == []' <<<$status_response) ]; then + echo "No statuses found for '${API_BASE}/commits/${COMMIT_SHA}'" + exit 1 +fi + +readonly statuses=$(jq -r '[.[].context] | @json' <<< $status_response) +if [ -z "$statuses" ]; then + echo "Failed to parse statuses for '${API_BASE}/commits/${COMMIT_SHA}'" + echo -e "Request returned:\n$status_response" + exit 1 +fi post_body="$(cat< Date: Thu, 30 Jul 2026 09:44:02 -0500 Subject: [PATCH 5/7] Add back global error handling --- post-cdash-status | 2 ++ 1 file changed, 2 insertions(+) diff --git a/post-cdash-status b/post-cdash-status index c472aea..7286730 100755 --- a/post-cdash-status +++ b/post-cdash-status @@ -1,5 +1,7 @@ #!/bin/bash +set -eo pipefail + readonly API_BASE="https://api.github.com/repos/${GITHUB_REPOSITORY}" function require_cmd() { From eeeade3da82ff30b030d1611317d75234151d892 Mon Sep 17 00:00:00 2001 From: Tim Haines Date: Thu, 30 Jul 2026 09:44:21 -0500 Subject: [PATCH 6/7] Use unique exit codes --- post-cdash-status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post-cdash-status b/post-cdash-status index 7286730..169b967 100755 --- a/post-cdash-status +++ b/post-cdash-status @@ -47,7 +47,7 @@ readonly statuses=$(jq -r '[.[].context] | @json' <<< $status_response) if [ -z "$statuses" ]; then echo "Failed to parse statuses for '${API_BASE}/commits/${COMMIT_SHA}'" echo -e "Request returned:\n$status_response" - exit 1 + exit 2 fi post_body="$(cat< Date: Thu, 30 Jul 2026 09:47:13 -0500 Subject: [PATCH 7/7] Update message for bad POST --- post-cdash-status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post-cdash-status b/post-cdash-status index 169b967..d934700 100755 --- a/post-cdash-status +++ b/post-cdash-status @@ -75,7 +75,7 @@ if [ "true" == $(jq -re "all(. != \"${GITHUB_STATUS_NAME}\")" <<<"${statuses}") if [ "false" == $(jq -r 'has("creator")') <<<"$response" ]; then echo "Failed to create status for '${API_BASE}/commits/${COMMIT_SHA}'" - echo "$response" + echo -e "Request returned:\n$response" exit 3 fi else