From 820de456aaa4a17b2e5beafea50ebd32f15fede6 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Wed, 29 Nov 2023 17:53:39 +0000 Subject: [PATCH] ci: refactor deprecated GitHub set-output commands --- .github/workflows/workflow.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 655057d6..e3f8c2c4 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -15,9 +15,11 @@ jobs: - uses: actions/checkout@v4 - name: Get Stack snapshot install directory id: stack-snapshot + # NOTE: `stack path` must run at least once prior to caching to ensure the directory + # exists and is populated. run: | stack path --snapshot-install-root - echo "::set-output name=dir::$(stack path --snapshot-install-root)" + echo "dir=$(stack path --snapshot-install-root)" > "${GITHUB_OUTPUT}" - uses: actions/cache@v3 with: path: ${{ steps.stack-snapshot.outputs.dir }} @@ -46,12 +48,14 @@ jobs: nix-env -f. -iA nixpkgs.stack - name: Get Stack snapshot install directory id: stack-snapshot + # NOTE: `stack path` must run at least once prior to caching to ensure the directory + # exists and is populated. + # NOTE: The renaming of the stack.yaml file is a workaround for + # https://github.com/commercialhaskell/stack/issues/5028. run: | - # XXX Workaround - # https://github.com/commercialhaskell/stack/issues/5028. [ ${{ matrix.stack_yaml }} = stack.yaml ] || mv ${{ matrix.stack_yaml }} stack.yaml stack --nix path --snapshot-install-root - echo "::set-output name=dir::$(stack --nix path --snapshot-install-root)" + echo "dir=$(stack --nix path --snapshot-install-root)" > "${GITHUB_OUTPUT}" - uses: actions/cache@v3 with: path: ${{ steps.stack-snapshot.outputs.dir }}