From 3d5a218709a8ba76dc135fb74e3eb8259c89b317 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 30 Jun 2025 17:45:12 +0200 Subject: [PATCH] actions: add test for hashFiles() As of https://code.forgejo.org/forgejo/act/commit/7c7d80ebdd4aee01bb858a828ad864aa120b4a75 a step with hashFiles('...') will lookup the file from the container running the job. --- .../.forgejo/workflows/test.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/actions/example-expression/.forgejo/workflows/test.yml b/actions/example-expression/.forgejo/workflows/test.yml index ab4bb646..e20a996a 100644 --- a/actions/example-expression/.forgejo/workflows/test.yml +++ b/actions/example-expression/.forgejo/workflows/test.yml @@ -98,10 +98,11 @@ jobs: set -x test "${{ fromJSON('["one","two"]')[0] }}" = 'one' - # As of act v1.13.0 this fails for real (before it pretended to work but did not) - # - name: hashFiles - # run: | - # set -x - # hash="bd52020371c038c4ad38a8d2df05dfa1a220d40fbe1ae83b63d6010cb527e531" - # test "${{ hashFiles('actions/example-expression/.forgejo/fileone.txt') }}" = $hash - # test "${{ hashFiles('actions/example-expression/.forgejo/fileone.*') }}" = $hash + - uses: actions/checkout@v4 + + - name: hashFiles + run: | + set -x + hash="aea6ca2329c852f5b480ec35e1fe09d39a6bd1b50f4f9cc38fbd4fef870dc107" + test "${{ hashFiles('.forgejo/fileone.txt') }}" = $hash + test "${{ hashFiles('.forgejo/fileone.*') }}" = $hash