Skip to content

Commit

Permalink
refactor: revert setup checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Sep 27, 2024
1 parent 8baa3bc commit fef1e4f
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
5 changes: 5 additions & 0 deletions actions/auto/push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ inputs:
runs:
using: composite
steps:
- uses: taiga-family/ci/actions/setup/checkout@main
with:
token: ${{ inputs.token }}
ref: ${{ github.ref }}
fetch-depth: 0
- name: Commit and push
shell: bash
run: |
Expand Down
57 changes: 57 additions & 0 deletions actions/setup/checkout/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Action for checkout git
description: Action for checkout git

inputs:
ref:
description: Ref
required: false
token:
description: Token
required: false
fetch-depth:
description: Fetch depth
default: '1'
required: false
fetch-tags:
description: Fetch tags
default: 'true'
required: false
submodules:
description: submodules
default: recursive
required: false

runs:
using: composite
steps:
- shell: bash
id: checks
run: |
echo "has-token=$([ -z "${{ inputs.token }}" ] && echo "false" || echo "true")" >> $GITHUB_OUTPUT
- shell: bash
run: |
echo "has token ~ ${{ steps.checks.outputs.has-token }}"
echo "ref ~ ${{ inputs.ref || github.event.pull_request.head.ref || github.head_ref || github.ref }}"
echo "repository ~ ${{ github.event.pull_request.head.repo.full_name || github.repository }}"
- uses: actions/checkout@v4.2.0
if: steps.checks.outputs.has-token == 'true'
with:
persist-credentials: false
token: ${{ inputs.token }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ inputs.ref || github.event.pull_request.head.ref || github.head_ref || github.ref }}
fetch-depth: ${{ inputs.fetch-depth }}
fetch-tags: ${{ inputs.fetch-tags }}
submodules: ${{ inputs.submodules }}

- uses: actions/checkout@v4.2.0
if: steps.checks.outputs.has-token == 'false'
with:
persist-credentials: false
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ inputs.ref || github.event.pull_request.head.ref || github.head_ref || github.ref }}
fetch-depth: ${{ inputs.fetch-depth }}
fetch-tags: ${{ inputs.fetch-tags }}
submodules: ${{ inputs.submodules }}

0 comments on commit fef1e4f

Please sign in to comment.