From eb6f5abee64e979dba25924f71ef86d2b3ca2deb Mon Sep 17 00:00:00 2001 From: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Date: Thu, 28 Mar 2024 17:42:20 +0100 Subject: [PATCH] [ci] fix subsystem-benchmarks gha (#3876) PR adds variables validation and app credentials for pushing into gh-pages cc https://github.com/paritytech/ci_cd/issues/934 --- .github/workflows/subsystem-benchmarks.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/subsystem-benchmarks.yml b/.github/workflows/subsystem-benchmarks.yml index 37a9e0f468..f0d56bf6e9 100644 --- a/.github/workflows/subsystem-benchmarks.yml +++ b/.github/workflows/subsystem-benchmarks.yml @@ -15,7 +15,13 @@ on: jobs: subsystem-benchmarks: runs-on: ubuntu-latest + environment: subsystem-benchmarks steps: + - name: Validate inputs + run: | + echo "${{ github.event.inputs.benchmark-data-dir-path }}" | grep -P '^[a-z\-]' + echo "${{ github.event.inputs.output-file-path }}" | grep -P '^[a-z\-]+\.json' + - name: Checkout Sources uses: actions/checkout@v4.1.2 with: @@ -30,7 +36,13 @@ jobs: - name: Switch branch id: step_two run: | - git checkout master + git checkout master -- + + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }} + private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }} - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 @@ -38,5 +50,5 @@ jobs: tool: "customSmallerIsBetter" output-file-path: ${{ github.event.inputs.output-file-path }} benchmark-data-dir-path: "bench/${{ github.event.inputs.benchmark-data-dir-path }}" - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ steps.app-token.outputs.token }} auto-push: true