Skip to content

Test env context

Test env context #6

Workflow file for this run

name: Test actions/checkout ref expansion
on:
workflow_dispatch:
inputs:
ref:
type: string
default: main
description: "The branch, tag, or SHA to checkout"
jobs:
run:
name: Test actions/checkout ref expansion
runs-on: ubuntu-latest
steps:
- name: Resolve inputs.ref to full SHA
id: resolve-ref
# https://github.com/actions/checkout/issues/265
run: |
sha=$(gh api /repos/$GITHUB_REPOSITORY/commits/${{ inputs.ref }} | jq -r .sha)
echo "sha=$sha" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: ${{ steps.resolve-ref.outputs.sha }}
- name: Verify checked out commit
run: git log -1