Add Ref and Commit outputs

Signed-off-by: Luca Comellini <luca.com@gmail.com>
This commit is contained in:
Luca Comellini
2023-02-16 11:10:37 -08:00
parent 44c2b7a8a4
commit 7c38ecfb34
5 changed files with 40 additions and 2 deletions

View File

@@ -295,3 +295,32 @@ jobs:
uses: actions/checkout@v3
with:
path: v3
test-output:
runs-on: ubuntu-latest
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v3
# Basic checkout using git
- name: Checkout basic
id: checkout
uses: ./
with:
ref: test-data/v2/basic
# Verify output
- name: Verify output
run: |
echo "Commit: ${{ steps.checkout.outputs.commit }}"
echo "Ref: ${{ steps.checkout.outputs.ref }}"
if [ "${{ steps.checkout.outputs.ref }}" != "test-data/v2/basic" ]; then
echo "Expected ref to be test-data/v2/basic"
exit 1
fi
# needed to make checkout post cleanup succeed
- name: Fix Checkout
uses: actions/checkout@v3