removed support for legacy ::set-ouput syntax, prefixed all git-related ouputs with git_
This commit is contained in:
parent
c6bb9b24b4
commit
bf0b6da3ed
66
action.yml
66
action.yml
@ -54,24 +54,13 @@ runs:
|
||||
REF_BRANCH=${REF/refs\/pull\//}
|
||||
REF_BRANCH=${REF_BRANCH/refs\/heads\//}
|
||||
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=base_ref_branch::$(eval printf "%s" "$BASE_REF")"
|
||||
echo "::set-output name=head_ref_branch::$(eval printf "%s" "$HEAD_REF")"
|
||||
echo "::set-output name=ref_branch::$(eval printf "%s" "$REF_BRANCH")"
|
||||
else
|
||||
echo "base_ref_branch=$(eval printf "%s" "$BASE_REF")" >> "$GITHUB_OUTPUT"
|
||||
echo "head_ref_branch=$(eval printf "%s" "$HEAD_REF")" >> "$GITHUB_OUTPUT"
|
||||
echo "ref_branch=$(eval printf "%s" "$REF_BRANCH")" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_base_ref_branch=$(eval printf "%s" "$BASE_REF")" >> "$GITHUB_OUTPUT"
|
||||
echo "git_head_ref_branch=$(eval printf "%s" "$HEAD_REF")" >> "$GITHUB_OUTPUT"
|
||||
echo "git_ref_branch=$(eval printf "%s" "$REF_BRANCH")" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
BASE_REF=$(printf "%q" "${{ github.event.base_ref }}")
|
||||
BASE_REF=${BASE_REF/refs\/heads\/${{ inputs.strip_tag_prefix }}/}
|
||||
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=base_ref_branch::$(eval printf "%s" "$BASE_REF")"
|
||||
else
|
||||
echo "base_ref_branch=$(eval printf "%s" "$BASE_REF")" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_base_ref_branch=$(eval printf "%s" "$BASE_REF")" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
@ -80,17 +69,9 @@ runs:
|
||||
# "Set the current branch name..."
|
||||
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||
if [[ ${{ github.event_name }} == *"pull_request"* ]]; then
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
|
||||
else
|
||||
echo "current_branch=${{ steps.branch.outputs.head_ref_branch }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_current_branch=${{ steps.branch.outputs.git_head_ref_branch }}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}"
|
||||
else
|
||||
echo "current_branch=${{ steps.branch.outputs.ref_branch }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_current_branch=${{ steps.branch.outputs.git_ref_branch }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
fi
|
||||
shell: bash
|
||||
@ -100,21 +81,11 @@ runs:
|
||||
# "Set the default branch name..."
|
||||
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ github.event.repository.default_branch }}" && "${{ github.event.pull_request.head.repo.fork }}" != "true" ]]; then
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=is_default::true"
|
||||
echo "::set-output name=default_branch::${{ github.event.repository.default_branch }}"
|
||||
else
|
||||
echo "is_default=true" >> "$GITHUB_OUTPUT"
|
||||
echo "default_branch=${{ github.event.repository.default_branch }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_is_default=true" >> "$GITHUB_OUTPUT"
|
||||
echo "git_default_branch=${{ github.event.repository.default_branch }}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=is_default::false"
|
||||
echo "::set-output name=default_branch::${{ github.event.repository.default_branch }}"
|
||||
else
|
||||
echo "is_default=false" >> "$GITHUB_OUTPUT"
|
||||
echo "default_branch=${{ github.event.repository.default_branch }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_is_default=false" >> "$GITHUB_OUTPUT"
|
||||
echo "git_default_branch=${{ github.event.repository.default_branch }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
fi
|
||||
shell: bash
|
||||
@ -125,27 +96,16 @@ runs:
|
||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||
REF=$(printf "%q" "${{ github.ref }}")
|
||||
TAG=${REF/refs\/tags\/${{ inputs.strip_tag_prefix }}/}
|
||||
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=tag::$(eval printf "%s" "$TAG")"
|
||||
echo "::set-output name=is_tag::true"
|
||||
else
|
||||
echo "tag=$(eval printf "%s" "$TAG")" >> "$GITHUB_OUTPUT"
|
||||
echo "is_tag=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_tag=$(eval printf "%s" "$TAG")" >> "$GITHUB_OUTPUT"
|
||||
echo "git_is_tag=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
if [[ -z "$GITHUB_OUTPUT" ]]; then
|
||||
echo "::set-output name=is_tag::false"
|
||||
else
|
||||
echo "is_tag=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "git_is_tag=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- id: ci_hostname
|
||||
run: |
|
||||
CI_HOSTNAME=$(echo $GITHUB_SERVER_URL | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/')
|
||||
echo "::set-output name=ci_hostname::$(eval printf "%s" "$CI_HOSTNAME")"
|
||||
echo "ci_hostname=$CI_HOSTNAME" >> "$GITHUB_OUTPUT"
|
||||
shell: bash
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user