Skip to content

fixes

fixes #14

Workflow file for this run

# SPDX-FileCopyrightText: 2023-2024 TII (SSRC) and the Ghaf contributors
#
# SPDX-License-Identifier: Apache-2.0
name: test
on:
workflow_dispatch:
push:
branches:
- test_versiontag
permissions:
contents: read
jobs:
build_target:
runs-on: ubuntu-latest
timeout-minutes: 360
name: Build FMO-OS
steps:
# To use this repository's private action,
# you must check out the repository
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: Generate build version
shell: bash
run: |

Check failure on line 31 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / test

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 31, Col: 14): Unexpected symbol: 'sha:0:7'. Located at position 8 within expression: github.sha:0:7
# Default to version based on GITHUB_SHA
buildver="${{ github.sha }}"
buildver="git-${buildver:0:7}"
if [[ "${{ github.ref_type }}" == "tag" ]]; then
buildver="${{ github.ref_name }}"
elif [[ "${{ github.ref_type }}" == "branch" ]]; then
# Check if there's a reachable tag on the branch
if git name-rev --name-only --tags --no-undefined "${{ github.ref }}" 2>/dev/null; then
buildver="$(git describe --tags "${{ github.ref }}")"
else
# No reachable parent tag on branch
buildver="${{ github.ref_name }}-${{ github.sha:0:7 }}"
fi
fi
echo "github.sha: ${{ github.sha }}"
echo "github.ref: ${{ github.ref }}"
echo "github.ref_type: ${{ github.ref_type }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "build_version=$buildver"
echo "build_version=$buildver" >> "$GITHUB_OUTPUT"