Skip to content

Commit

Permalink
Merge branch 'main' into renovate/golang.org-x-term-0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijie-yang authored Oct 23, 2024
2 parents 66943cf + 9fc2f8d commit a96b122
Show file tree
Hide file tree
Showing 46 changed files with 1,332 additions and 229 deletions.
52 changes: 52 additions & 0 deletions .github/actions/checkout/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Git Checkout
description: 'Checkout action supporting both github and non github repositories.'


inputs:
repository:
description: 'Github repository in the format owner/repo or external http(s) URL'
required: true
ref:
description: 'The branch, tag or SHA to checkout'
default: ''
path:
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
default: '.'
submodules:
description: 'Whether to checkout submodules. true|false|recursive according to actions/checkout@v4'
default: 'false'
github-server-url:
description: 'The base URL for the GitHub instance that you are trying to clone from'
default: 'https://github.com'

runs:
using: "composite"
steps:
- name: Checkout
shell: bash
run: |
# If URL lacks the protocol, assume it is a github repo
if [[ "${{ inputs.repository }}" =~ https?:// ]]
then
git_url="${{ inputs.repository }}"
else
git_url="${{ inputs.github-server-url }}/${{ inputs.repository }}.git"
fi
# create repo path relative to GITHUB_WORKSPACE as per actions/checkout@v4
repo_path="$GITHUB_WORKSPACE/${{ inputs.path }}"
# clone the repo and cd into it
git clone $git_url "$repo_path"
cd "$repo_path"
# checkout the correct ref
git config advice.detachedHead false
git checkout ${{ inputs.ref }}
# and update sub modules if required
if ${{ inputs.submodules == 'true' || inputs.submodules == 'recursive' }}
then
git submodule update ${{ inputs.submodules == 'recursive' && '--recursive' || '' }}
fi
2 changes: 1 addition & 1 deletion .github/base_digests/20.04
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public.ecr.aws/ubuntu/ubuntu:focal@sha256:036c51fb190af9d3ec7fbd654c2669d5a3da3549aa0e3408b40ba6fb6eb16dfc
public.ecr.aws/ubuntu/ubuntu:focal@sha256:4a885c102bc7de9ff2ffc4b11b65f35e46827d608069cd959181718aa7d14731
Loading

0 comments on commit a96b122

Please # to comment.