From 26fe28ef1e2c975b623a2948307fc03b2289c871 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 27 Jul 2025 14:03:10 +0000 Subject: [PATCH] feat: cache the workdir of the release-notes-assistant (#69) there is no need for additional testing: the existing tests covering the use of the release-notes-assistant will unconditionally use the cache and be proof it does not break things Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/69 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- action.yml | 7 +++++++ forgejo-release.sh | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 63ab2f0..2c70085 100644 --- a/action.yml +++ b/action.yml @@ -57,6 +57,12 @@ inputs: runs: using: "composite" steps: + - if: ${{ inputs.release-notes-assistant }} + uses: https://data.forgejo.org/actions/cache@v4 + with: + key: rna-${{ inputs.repo }} + path: ${{ forge.action_path }}/rna + - run: echo "${{ forge.action_path }}" >> $FORGEJO_PATH shell: bash - run: | @@ -78,6 +84,7 @@ runs: export PRERELEASE="${{ inputs.prerelease }}" export RELEASE_NOTES_ASSISTANT="${{ inputs.release-notes-assistant }}" + export RELEASE_NOTES_ASSISTANT_WORKDIR=${{ forge.action_path }}/rna export HIDE_ARCHIVE_LINK="${{ inputs.hide-archive-link }}" diff --git a/forgejo-release.sh b/forgejo-release.sh index 85d56e0..dfabf0c 100755 --- a/forgejo-release.sh +++ b/forgejo-release.sh @@ -120,7 +120,8 @@ maybe_use_release_note_assistant() { if "$RELEASE_NOTES_ASSISTANT"; then curl --fail -s -S -o rna https://code.forgejo.org/forgejo/release-notes-assistant/releases/download/$RELEASE_NOTES_ASSISTANT_VERSION/release-notes-assistant chmod +x ./rna - ./rna --storage release --storage-location "$TAG" --forgejo-url "$SCHEME"://placeholder:"$TOKEN"@"$HOST" --repository $REPO --token "$TOKEN" release "$TAG" + mkdir -p $RELEASE_NOTES_ASSISTANT_WORKDIR + ./rna --workdir=$RELEASE_NOTES_ASSISTANT_WORKDIR --storage release --storage-location "$TAG" --forgejo-url "$SCHEME"://placeholder:"$TOKEN"@"$HOST" --repository $REPO --token "$TOKEN" release "$TAG" fi }