From 61b7084f1e13255ba2084280fe9f8029cb9a595b Mon Sep 17 00:00:00 2001 From: Pascal Zimmermann Date: Thu, 15 Jan 2026 14:44:16 +0100 Subject: [PATCH 1/2] fix: Add tags support --- action.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index a971657..5d5f055 100644 --- a/action.yml +++ b/action.yml @@ -36,6 +36,7 @@ runs: id: check-changed-files env: ACTION_REF: ${{ github.action_ref }} + ACTION_SHA: ${{ github.action_sha }} run: | # Check if curl is installed, if not install it if ! command -v curl &> /dev/null; then @@ -58,7 +59,17 @@ runs: if [ -n "${{ inputs.github_user_token }}" ]; then AUTH_PREFIX="oauth2:${{ inputs.github_user_token }}@" fi - curl -s -L -o /tmp/check_changed_files.py https://${AUTH_PREFIX}raw.githubusercontent.com/ZPascal/check-changed-files-action/refs/heads/$ACTION_REF/src/check_changed_files.py + + # Determine the correct ref (tag, branch, or commit SHA) + if [ -n "$ACTION_REF" ]; then + # Use tag if available + REF_PATH="refs/tags/$ACTION_REF" + else + # Fallback to commit SHA or main branch + REF_PATH="${ACTION_SHA:-main}" + fi + + curl -s -L -o /tmp/check_changed_files.py "https://${AUTH_PREFIX}raw.githubusercontent.com/ZPascal/check-changed-files-action/$REF_PATH/src/check_changed_files.py" optional_flags="" if [ -n "${{ inputs.git_location }}" ]; then From b45a3b556be691c0cd1e2efc670165284d0418fc Mon Sep 17 00:00:00 2001 From: Pascal Zimmermann Date: Thu, 15 Jan 2026 16:03:09 +0100 Subject: [PATCH 2/2] feat: Update the start script --- action.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 5d5f055..d8e5e56 100644 --- a/action.yml +++ b/action.yml @@ -60,13 +60,18 @@ runs: AUTH_PREFIX="oauth2:${{ inputs.github_user_token }}@" fi - # Determine the correct ref (tag, branch, or commit SHA) - if [ -n "$ACTION_REF" ]; then - # Use tag if available - REF_PATH="refs/tags/$ACTION_REF" + # Determine the correct ref (commit SHA, tag, branch, or default to main) + if [ -n "$ACTION_SHA" ]; then + # Use commit SHA as primary reference (always valid) + REF_PATH="$ACTION_SHA" + elif [ -n "$ACTION_REF" ]; then + # Extract the actual ref name from refs/tags/* or refs/heads/* + # ACTION_REF format: refs/tags/v1.0.0 or refs/heads/main + REF_PATH="${ACTION_REF#refs/tags/}" + REF_PATH="${REF_PATH#refs/heads/}" else - # Fallback to commit SHA or main branch - REF_PATH="${ACTION_SHA:-main}" + # Fallback to main branch + REF_PATH="main" fi curl -s -L -o /tmp/check_changed_files.py "https://${AUTH_PREFIX}raw.githubusercontent.com/ZPascal/check-changed-files-action/$REF_PATH/src/check_changed_files.py"