From 841ca7c2c6038335691b0f0e67d09c8c6a8b7827 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 21 Jul 2025 20:31:52 +0000 Subject: [PATCH] actions: as of Forgejo runner v8.0.0 FORGEJO_ACTION_PATH is hash based (#823) Refs: https://code.forgejo.org/forgejo/act/pulls/186 Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/823 Reviewed-by: Michael Kriese Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/example-context/action-for-context/action.yml | 5 ++++- .../example-local-action/.forgejo/local-action/action.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/actions/example-context/action-for-context/action.yml b/actions/example-context/action-for-context/action.yml index e8e81c39..301d7280 100644 --- a/actions/example-context/action-for-context/action.yml +++ b/actions/example-context/action-for-context/action.yml @@ -20,7 +20,10 @@ runs: shell: bash run: | set -x - [[ "$FORGEJO_ACTION_PATH" =~ action-for-context@main$ ]] + # prior to Forgejo runner 8.0.0 the action path is built out of the file path. + # with Forgejo runner 8.0.0 and above is it a 64 character hash string + # e.g. /var/run/act/actions/1b/5c1802fa47e35716c2a0977bc907049d31aef29191cba400011c0b38b52d12 + [[ "$FORGEJO_ACTION_PATH" =~ action-for-context@main$ ]] || [[ "$FORGEJO_ACTION_PATH" =~ /[0-9a-f]{2}/[0-9a-f]{62}$ ]] test "$FORGEJO_ACTION_PATH" = "${{ github.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "${{ forge.ACTION_PATH }}" test "$FORGEJO_ACTION_PATH" = "$GITHUB_ACTION_PATH" diff --git a/actions/example-local-action/.forgejo/local-action/action.yml b/actions/example-local-action/.forgejo/local-action/action.yml index 6f5df8e1..900bc1c1 100644 --- a/actions/example-local-action/.forgejo/local-action/action.yml +++ b/actions/example-local-action/.forgejo/local-action/action.yml @@ -16,7 +16,7 @@ runs: - name: FORGEJO_ACTION_PATH run: | set -x - test "$(basename $FORGEJO_ACTION_PATH)" = local-action + test -e "$FORGEJO_ACTION_PATH" test "$FORGEJO_ACTION_PATH" = "${{ env.FORGEJO_ACTION_PATH }}" - run: echo key=${{ inputs.input-two-required }} >> $FORGEJO_OUTPUT