5 ms·
Looking for one as well. My gh actions broke and looking for a drop in replacement. Got this working with claude, would love if someone with more knowledge had
by kareemery 2y ago
Looking for one as well. My gh actions broke and looking for a drop in replacement.
Got this working with claude, would love if someone with more knowledge had thoughts:
```bash
# Extract branch name from GITHUB_REF or GITHUB_HEAD_REF
echo "current_branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
# Determine if this is the default branch
if [[ "${GITHUB_REF#refs/heads/}" == "${GITHUB_REF_NAME}" && "${GITHUB_REF_NAME}" == "${GITHUB_BASE_REF:-${GITHUB_REF_NAME}}" ]]; then
echo "is_default=true" >> $GITHUB_OUTPUT
else
echo "is_default=false" >> $GITHUB_OUTPUT
fi
# Set default branch name
echo "default_branch=${GITHUB_BASE_REF:-${GITHUB_REF_NAME}}" >> $GITHUB_OUTPUT
```