From 8d7f8f9e4b81d5713c0f6d97edadb0faf141c2e1 Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Tue, 19 Aug 2025 18:09:00 -0400 Subject: [PATCH 01/10] Refactored support for local npm registry. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6b9ae70..9a2f2e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /**/.DS_Store -/.npmrc From 2e1424ec8269e430e9dc332edd57e979ab828756 Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:04:16 -0500 Subject: [PATCH 02/10] Updated repository documentation. --- README.md | 3 +++ profile/README.md | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ac6ff0e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# GitHub Configuration + +This repository is used to configure GitHub for the AIDC Toolkit organization and to host stable actions for workflows. diff --git a/profile/README.md b/profile/README.md index 7a6c842..94819d1 100644 --- a/profile/README.md +++ b/profile/README.md @@ -1,5 +1,3 @@ # AIDC Toolkit -Welcome to the AIDC Toolkit, a comprehensive set of libraries for integrating Automatic Identification and Data Capture -(AIDC) functionality into web-based applications. To find out what it's all about, go to the -[documentation](https://aidc-toolkit.com) or explore the repositories. +Welcome to the AIDC Toolkit, a comprehensive set of libraries for integrating Automatic Identification and Data Capture (AIDC) functionality into web-based applications. To find out what it's all about, go to the [documentation](https://aidc-toolkit.com) or explore the repositories. From aa4a7d59aaae987ad613f6764ae7bdb52dacf18d Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:04:46 -0500 Subject: [PATCH 03/10] Added ref-branch action. --- .github/actions/ref-branch/action.yml | 46 +++++++++++++++++++++++++++ .github/workflows/test-ref-branch.yml | 20 ++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/actions/ref-branch/action.yml create mode 100644 .github/workflows/test-ref-branch.yml diff --git a/.github/actions/ref-branch/action.yml b/.github/actions/ref-branch/action.yml new file mode 100644 index 0000000..f70b019 --- /dev/null +++ b/.github/actions/ref-branch/action.yml @@ -0,0 +1,46 @@ +name: Reference branch +description: Parse the GitHub context reference properties to determine the branch on which the workflow is running + +outputs: + branch: + description: Fully formed reference of the branch + value: ${{ steps.ref-branch.outputs.branch }} + branch_name: + description: Short reference name of the branch + value: ${{ steps.ref-branch.outputs.branch_name }} + +runs: + using: composite + + steps: + - name: Reference branch + id: ref-branch + shell: bash + run: | + if [[ "${{ github.ref_type }}" = "branch" ]] + then + # Reference is branch. + branch="${{ github.ref }}" + branch_name="${{ github.ref_name }}" + elif [[ "${{ github.ref_type }}" = "tag" ]] + then + branch_name=`git branch --remote --contains tags/${{ github.ref_name }} | cut -d '/' -f 2` + branch_name_lines=`echo $branch_name | wc -l | xargs` + + if [[ $branch_name_lines != 1 ]] + then + echo "Tag ${{ github.ref_name }} is not associated with a unique branch" + exit 1 + fi + + branch="refs/heads/$branch_name" + else + echo "Unsupported reference type ${{ github.ref_type }}" + exit 1 + fi + + echo "Branch is $branch" + echo "Branch name is $branch_name" + + echo "branch=$branch" >> $GITHUB_OUTPUT + echo "branch_name=$branch_name" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test-ref-branch.yml b/.github/workflows/test-ref-branch.yml new file mode 100644 index 0000000..908a749 --- /dev/null +++ b/.github/workflows/test-ref-branch.yml @@ -0,0 +1,20 @@ +name: Test reference branch + +on: + workflow_call: + push: + release: + +jobs: + test-ref-branch: + runs-on: ubuntu-latest + + steps: + - name: Reference branch + id: ref-branch + uses: aidc-toolkit/.github/actions/ref-branch@main + + - name: Show branch + run: | + echo "branch=${{ steps.ref-branch.outputs.branch }}" + echo "branch_name=${{ steps.ref-branch.outputs.branch_name }}" From 917485064b7037618f3bc32bff703baeb1409fb8 Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:06:38 -0500 Subject: [PATCH 04/10] Fixed version in ref-branch call. --- .github/workflows/test-ref-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-ref-branch.yml b/.github/workflows/test-ref-branch.yml index 908a749..767d26b 100644 --- a/.github/workflows/test-ref-branch.yml +++ b/.github/workflows/test-ref-branch.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Reference branch id: ref-branch - uses: aidc-toolkit/.github/actions/ref-branch@main + uses: aidc-toolkit/.github/actions/ref-branch@v0.9 - name: Show branch run: | From 6971c63c72787f8337dc22176a227ec0a2134d95 Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:09:14 -0500 Subject: [PATCH 05/10] Moved actions directory to top level. --- {.github/actions => actions}/ref-branch/action.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.github/actions => actions}/ref-branch/action.yml (100%) diff --git a/.github/actions/ref-branch/action.yml b/actions/ref-branch/action.yml similarity index 100% rename from .github/actions/ref-branch/action.yml rename to actions/ref-branch/action.yml From 2f68a60961f27967a172ffe3e17f118b3c3cc06f Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:14:05 -0500 Subject: [PATCH 06/10] Refined testing. --- .github/workflows/test-ref-branch.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-ref-branch.yml b/.github/workflows/test-ref-branch.yml index 767d26b..8d96391 100644 --- a/.github/workflows/test-ref-branch.yml +++ b/.github/workflows/test-ref-branch.yml @@ -4,12 +4,16 @@ on: workflow_call: push: release: + types: [published] jobs: test-ref-branch: runs-on: ubuntu-latest steps: + - name: Checkout default repository + uses: actions/checkout@v5 + - name: Reference branch id: ref-branch uses: aidc-toolkit/.github/actions/ref-branch@v0.9 From 987323bd034716c8c795c97ed1a77080a1cee124 Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:19:06 -0500 Subject: [PATCH 07/10] Added terminal session for testing. --- actions/ref-branch/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/actions/ref-branch/action.yml b/actions/ref-branch/action.yml index f70b019..7112db8 100644 --- a/actions/ref-branch/action.yml +++ b/actions/ref-branch/action.yml @@ -13,6 +13,9 @@ runs: using: composite steps: + - name: Start terminal session + uses: mxschmitt/action-tmate@v3 + - name: Reference branch id: ref-branch shell: bash From 7f5ea6ad5dbbd902fca47c37e582a69cbfe7e3f9 Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:31:27 -0500 Subject: [PATCH 08/10] Added fetch-tags requirement. --- .github/workflows/test-ref-branch.yml | 2 ++ actions/ref-branch/action.yml | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/test-ref-branch.yml b/.github/workflows/test-ref-branch.yml index 8d96391..944fd9d 100644 --- a/.github/workflows/test-ref-branch.yml +++ b/.github/workflows/test-ref-branch.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout default repository uses: actions/checkout@v5 + with: + fetch-tags: 'true' - name: Reference branch id: ref-branch diff --git a/actions/ref-branch/action.yml b/actions/ref-branch/action.yml index 7112db8..64e6f7e 100644 --- a/actions/ref-branch/action.yml +++ b/actions/ref-branch/action.yml @@ -28,6 +28,13 @@ runs: elif [[ "${{ github.ref_type }}" = "tag" ]] then branch_name=`git branch --remote --contains tags/${{ github.ref_name }} | cut -d '/' -f 2` + + if [[ "$branch_name" = "" ]] + then + echo "Checkout action requires \"fetch-tags: 'true'\"" + exit 1 + fi + branch_name_lines=`echo $branch_name | wc -l | xargs` if [[ $branch_name_lines != 1 ]] From 08388729c92a798a926aba97d5937f02e3f6119f Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:38:44 -0500 Subject: [PATCH 09/10] Moved fetch tags to action. --- .github/workflows/test-ref-branch.yml | 2 -- actions/ref-branch/action.yml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-ref-branch.yml b/.github/workflows/test-ref-branch.yml index 944fd9d..8d96391 100644 --- a/.github/workflows/test-ref-branch.yml +++ b/.github/workflows/test-ref-branch.yml @@ -13,8 +13,6 @@ jobs: steps: - name: Checkout default repository uses: actions/checkout@v5 - with: - fetch-tags: 'true' - name: Reference branch id: ref-branch diff --git a/actions/ref-branch/action.yml b/actions/ref-branch/action.yml index 64e6f7e..07e742f 100644 --- a/actions/ref-branch/action.yml +++ b/actions/ref-branch/action.yml @@ -27,6 +27,8 @@ runs: branch_name="${{ github.ref_name }}" elif [[ "${{ github.ref_type }}" = "tag" ]] then + git fetch --tags + branch_name=`git branch --remote --contains tags/${{ github.ref_name }} | cut -d '/' -f 2` if [[ "$branch_name" = "" ]] From 56f84a22e5e26a343349775f192efaec0df1364b Mon Sep 17 00:00:00 2001 From: Kevin Dean Date: Sun, 23 Nov 2025 17:48:55 -0500 Subject: [PATCH 10/10] Cleaned up debugging. --- .github/workflows/test-ref-branch.yml | 3 +-- actions/ref-branch/action.yml | 11 ++--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-ref-branch.yml b/.github/workflows/test-ref-branch.yml index 8d96391..ecb5b6d 100644 --- a/.github/workflows/test-ref-branch.yml +++ b/.github/workflows/test-ref-branch.yml @@ -1,7 +1,6 @@ name: Test reference branch on: - workflow_call: push: release: types: [published] @@ -16,7 +15,7 @@ jobs: - name: Reference branch id: ref-branch - uses: aidc-toolkit/.github/actions/ref-branch@v0.9 + uses: aidc-toolkit/.github/actions/ref-branch@main - name: Show branch run: | diff --git a/actions/ref-branch/action.yml b/actions/ref-branch/action.yml index 07e742f..9efdbf3 100644 --- a/actions/ref-branch/action.yml +++ b/actions/ref-branch/action.yml @@ -13,9 +13,6 @@ runs: using: composite steps: - - name: Start terminal session - uses: mxschmitt/action-tmate@v3 - - name: Reference branch id: ref-branch shell: bash @@ -27,18 +24,14 @@ runs: branch_name="${{ github.ref_name }}" elif [[ "${{ github.ref_type }}" = "tag" ]] then + # Tags are required to resolve the branch. git fetch --tags branch_name=`git branch --remote --contains tags/${{ github.ref_name }} | cut -d '/' -f 2` - if [[ "$branch_name" = "" ]] - then - echo "Checkout action requires \"fetch-tags: 'true'\"" - exit 1 - fi - branch_name_lines=`echo $branch_name | wc -l | xargs` + # Tag must have a unique branch. if [[ $branch_name_lines != 1 ]] then echo "Tag ${{ github.ref_name }} is not associated with a unique branch"