Skip to content

Commit

Permalink
Make post-if conditional on save-always
Browse files Browse the repository at this point in the history
  • Loading branch information
friendlyanon committed Oct 6, 2024
1 parent 58e39ca commit 4d5a9d4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,33 @@ jobs:

- uses: ./
id: vcpkg
with: { committish: "0e47c1985273129e4d0ee52ff73bed9125555de8" }
with:
committish: "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3"
cache-version: default

- run: |
printf $'Cache hit: \'%s\'\nVCPKG_DEFAULT_BINARY_CACHE: \'%s\'\n' \
"${{ steps.vcpkg.outputs.cache-hit }}" \
"$VCPKG_DEFAULT_BINARY_CACHE"
$VCPKG_ROOT/vcpkg version
build-save-always:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: ./
id: vcpkg
with:
committish: "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3"
cache-version: save-always
save-always: true

- run: |
printf $'Cache hit: \'%s\'\nVCPKG_DEFAULT_BINARY_CACHE: \'%s\'\n' \
"${{ steps.vcpkg.outputs.cache-hit }}" \
"$VCPKG_DEFAULT_BINARY_CACHE"
$VCPKG_ROOT/vcpkg version
- run: "false"
6 changes: 5 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ inputs:
default: "false"
description: Disables the cache saving post step if true.

save-always:
default: "false"
description: Always run the "post" script to save whatever is in the cache.

outputs:
cache-hit:
description: >-
Expand All @@ -77,4 +81,4 @@ runs:
using: node20
main: dist/main.js
post: dist/post.js
post-if: success()
post-if: github.event.inputs.save-always || success()

0 comments on commit 4d5a9d4

Please sign in to comment.