chore: add helpful step comments

This commit is contained in:
Tonye Jack 2022-08-21 10:59:36 -06:00 committed by GitHub
parent 9a84c5671b
commit 6f52001f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,7 @@ runs:
steps: steps:
- id: branch - id: branch
run: | run: |
# "Set branch names..."
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
BASE_REF=$(printf "%q" "${{ github.base_ref }}") BASE_REF=$(printf "%q" "${{ github.base_ref }}")
HEAD_REF=$(printf "%q" "${{ github.head_ref }}") HEAD_REF=$(printf "%q" "${{ github.head_ref }}")
@ -57,6 +58,7 @@ runs:
shell: bash shell: bash
- id: current_branch - id: current_branch
run: | run: |
# "Set the current branch name..."
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
if [[ ${{ github.event_name }} == 'pull_request' ]]; then if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}" echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
@ -72,6 +74,7 @@ runs:
shell: bash shell: bash
- id: default - id: default
run: | run: |
# "Set the default branch name..."
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ github.event.repository.default_branch }}" ]]; then if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ github.event.repository.default_branch }}" ]]; then
echo "::set-output name=is_default::true" echo "::set-output name=is_default::true"
@ -84,6 +87,7 @@ runs:
shell: bash shell: bash
- id: tag - id: tag
run: | run: |
# "Set the tag name..."
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
REF=$(printf "%q" "${{ github.ref }}") REF=$(printf "%q" "${{ github.ref }}")
TAG=${REF/refs\/tags\/${{ inputs.strip_tag_prefix }}/} TAG=${REF/refs\/tags\/${{ inputs.strip_tag_prefix }}/}