Inline Forgejo workflow checkout
This commit is contained in:
parent
fbe8643914
commit
aa577c5616
3 changed files with 45 additions and 12 deletions
|
|
@ -19,10 +19,21 @@ jobs:
|
||||||
runs-on: [self-hosted, linux, x86_64, burrow-forge]
|
runs-on: [self-hosted, linux, x86_64, burrow-forge]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://code.forgejo.org/actions/checkout@v4
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
token: ${{ github.token }}
|
set -euo pipefail
|
||||||
fetch-depth: 0
|
repo_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
if [ ! -d .git ]; then
|
||||||
|
git init .
|
||||||
|
fi
|
||||||
|
if git remote get-url origin >/dev/null 2>&1; then
|
||||||
|
git remote set-url origin "${repo_url}"
|
||||||
|
else
|
||||||
|
git remote add origin "${repo_url}"
|
||||||
|
fi
|
||||||
|
git fetch --force --tags origin "${GITHUB_SHA}"
|
||||||
|
git checkout --force --detach FETCH_HEAD
|
||||||
|
git clean -ffdqx
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,21 @@ jobs:
|
||||||
runs-on: [self-hosted, linux, x86_64, burrow-forge]
|
runs-on: [self-hosted, linux, x86_64, burrow-forge]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://code.forgejo.org/actions/checkout@v4
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
token: ${{ github.token }}
|
set -euo pipefail
|
||||||
fetch-depth: 0
|
repo_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
if [ ! -d .git ]; then
|
||||||
|
git init .
|
||||||
|
fi
|
||||||
|
if git remote get-url origin >/dev/null 2>&1; then
|
||||||
|
git remote set-url origin "${repo_url}"
|
||||||
|
else
|
||||||
|
git remote add origin "${repo_url}"
|
||||||
|
fi
|
||||||
|
git fetch --force --tags origin "${GITHUB_SHA}"
|
||||||
|
git checkout --force --detach FETCH_HEAD
|
||||||
|
git clean -ffdqx
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,21 @@ jobs:
|
||||||
runs-on: [self-hosted, linux, x86_64, burrow-forge]
|
runs-on: [self-hosted, linux, x86_64, burrow-forge]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://code.forgejo.org/actions/checkout@v4
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
token: ${{ github.token }}
|
set -euo pipefail
|
||||||
fetch-depth: 0
|
repo_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
if [ ! -d .git ]; then
|
||||||
|
git init .
|
||||||
|
fi
|
||||||
|
if git remote get-url origin >/dev/null 2>&1; then
|
||||||
|
git remote set-url origin "${repo_url}"
|
||||||
|
else
|
||||||
|
git remote add origin "${repo_url}"
|
||||||
|
fi
|
||||||
|
git fetch --force --tags origin "${GITHUB_SHA}"
|
||||||
|
git checkout --force --detach FETCH_HEAD
|
||||||
|
git clean -ffdqx
|
||||||
|
|
||||||
- name: Validate BEP metadata
|
- name: Validate BEP metadata
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue