Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/test-ref-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test reference branch

on:
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@main

- name: Show branch
run: |
echo "branch=${{ steps.ref-branch.outputs.branch }}"
echo "branch_name=${{ steps.ref-branch.outputs.branch_name }}"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/**/.DS_Store
/.npmrc
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
51 changes: 51 additions & 0 deletions actions/ref-branch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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
# Tags are required to resolve the branch.
git fetch --tags

branch_name=`git branch --remote --contains tags/${{ github.ref_name }} | cut -d '/' -f 2`

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"
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
4 changes: 1 addition & 3 deletions profile/README.md
Original file line number Diff line number Diff line change
@@ -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.
Loading