From 00057a94d54585adfd9edba60520151fb75d663e Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 16 Sep 2024 14:36:10 +0200 Subject: [PATCH] GitHub Actions: Add Accept http header for ccache artifact download The ccache artifacts were created, but were no longer downloaded and the builds were done without ccache. Change-Id: I1ecb9a6597c2e67c0fd1dcef48db086c43af47cd Reviewed-by: Cristian Adam --- .github/workflows/build_cmake.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 9d04d60bd65..042b93da6f8 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -490,15 +490,12 @@ jobs: - name: Download ccache archive shell: cmake -P {0} run: | - file(WRITE $ENV{GITHUB_WORKSPACE}/netrc.txt - "default login runneradmin password ${{ secrets.GITHUB_TOKEN }}") - foreach(page_id RANGE 1 10) file( DOWNLOAD "https://api.github.com/repos/${{ github.repository }}/actions/artifacts?per_page=100&page=${page_id}" - HTTPHEADER "Accept: application/vnd.github.v3+json" - NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt" - NETRC REQUIRED + HTTPHEADER "Accept: application/vnd.github+json" + HTTPHEADER "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" + HTTPHEADER "X-GitHub-Api-Version: 2022-11-28" SHOW_PROGRESS artifacts.json) file(READ artifacts.json artifacts_json) @@ -515,8 +512,9 @@ jobs: foreach(retry RANGE 10) file(DOWNLOAD "${download_url}" "${{ steps.ccache.outputs.archive_name }}.zip" - NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt" - NETRC REQUIRED + HTTPHEADER "Accept: application/vnd.github+json" + HTTPHEADER "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" + HTTPHEADER "X-GitHub-Api-Version: 2022-11-28" SHOW_PROGRESS) file(SIZE "${{ steps.ccache.outputs.archive_name }}.zip" fileSize) if (fileSize GREATER 0)