From c34596354c4a9b070802e321e6c2960ad19b266d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Tue, 25 Feb 2025 18:34:40 +0100 Subject: [PATCH] Initial checkout action --- .forgejo/workflows/test_workflow.yml | 10 ++++++++++ checkout/action.yml | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .forgejo/workflows/test_workflow.yml create mode 100644 checkout/action.yml diff --git a/.forgejo/workflows/test_workflow.yml b/.forgejo/workflows/test_workflow.yml new file mode 100644 index 0000000..97358e2 --- /dev/null +++ b/.forgejo/workflows/test_workflow.yml @@ -0,0 +1,10 @@ +on: + push: +jobs: + test: + runs-on: docker + container: + image: git.hswro.org/fleg/actions-experiments:latest + steps: + - uses: codeberg.org/fleg/light-actions/checkout@v1 + - run: cat README diff --git a/checkout/action.yml b/checkout/action.yml new file mode 100644 index 0000000..657becf --- /dev/null +++ b/checkout/action.yml @@ -0,0 +1,23 @@ +name: checkout +description: Checkout the git repository. +runs: + using: composite + steps: + - run: | + set -eu + if ! command -v bash >/dev/null; then + printf 'Bash is needed to use this action.' + exit 1 + fi + if ! command -v git >/dev/null; then + printf 'Git is needed to use this action.' + exit 1 + fi + shell: sh + - run: | + set -eu + git init + git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" + git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "+${GITHUB_SHA}:${GITHUB_REF}" + git checkout --force "${GITHUB_REF}" + shell: bash \ No newline at end of file