diff --git a/.github/workflows/arm64-rpi-fatpack-image.yml b/.github/workflows/arm64-rpi-fatpack-image.yml index 960957240..63934ae6b 100644 --- a/.github/workflows/arm64-rpi-fatpack-image.yml +++ b/.github/workflows/arm64-rpi-fatpack-image.yml @@ -36,8 +36,6 @@ jobs: - name: Set values id: set_values run: | - echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV - echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV if [ -z "$GITHUB_HEAD_REF" ]; then echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV else @@ -50,7 +48,7 @@ jobs: fi - name: Display the build name - run: echo "Building the raspiblitz-arm64-rpi-base-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }}" + run: echo "Building the raspiblitz-arm64-rpi-base-image" - name: Run the build script run: | @@ -66,7 +64,7 @@ jobs: - name: Upload the base image and checksum uses: actions/upload-artifact@v4 with: - name: raspiblitz-arm64-rpi-base-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }} + name: raspiblitz-arm64-rpi-base-image path: | ${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-base.img.sha256 ${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-base.img @@ -94,10 +92,26 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set values + id: set_values + run: | + echo "BUILD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV + echo "BUILD_VERSION=$(git describe --always --tags)" >> $GITHUB_ENV + if [ -z "$GITHUB_HEAD_REF" ]; then + echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + else + echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + fi + if [[ "${{github.event_name}}" == "pull_request" ]]; then + echo "GITHUB_USER=${{github.event.pull_request.head.repo.owner.login}}" >> $GITHUB_OUTPUT + else + echo "GITHUB_USER=$(echo ${{github.repository}} | cut -d'/' -f1)" >> $GITHUB_OUTPUT + fi + - name: Download base image uses: actions/download-artifact@v4 with: - name: raspiblitz-arm64-rpi-base-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }} + name: raspiblitz-arm64-rpi-base-image path: ci/arm64-rpi - name: Set the "image_checksum" variable @@ -136,7 +150,7 @@ jobs: - name: Upload the image and checksums uses: actions/upload-artifact@v4 with: - name: raspiblitz-arm64-fatpack-rpi-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }} + name: raspiblitz-arm64-rpi-fatpack-image-${{ env.BUILD_DATE }}-${{ env.BUILD_VERSION }} path: | ${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-fatpack.img.sha256 ${{ github.workspace }}/ci/arm64-rpi/raspiblitz-arm64-rpi-fatpack.img.gz