From c09c9b0ec93ba5d419910fe5d2c18193cd6de6fa Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Fri, 13 Oct 2023 22:05:42 +0200 Subject: [PATCH] Add check for supported languages --- .github/workflows/upload-docs.yml | 33 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml index 187cecd8d3..4682c3217e 100644 --- a/.github/workflows/upload-docs.yml +++ b/.github/workflows/upload-docs.yml @@ -4,12 +4,32 @@ on: release: types: [published] +env: + GH_TOKEN: ${{ github.token }} + +permissions: + actions: 'write' + jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Get release language + id: get_release_language + run: | + if [[ ${{ github.ref }} == *"python"* ]]; then + echo LANGUAGE="python" >> $GITHUB_OUTPUT + fi + if [[ ${{ github.ref }} == *"nodejs"* ]]; then + echo LANGUAGE="nodejs" >> $GITHUB_OUTPUT + fi + + - name: Check if release language is supported + if: steps.get_release_language.outputs.LANGUAGE != 'python' && steps.get_release_language.outputs.LANGUAGE != 'nodejs' + run: gh run cancel ${{ github.run_id }} + - name: Set up Rust uses: ./.github/actions/setup-rust with: @@ -27,19 +47,6 @@ jobs: sudo apt-get update sudo apt-get install libudev-dev libusb-1.0-0-dev - - name: Echo tag - run: echo ${{ github.ref }} - - - name: Get release language - id: get_release_language - run: | - if [[ ${{ github.ref }} == *"python"* ]]; then - echo LANGUAGE="python" >> $GITHUB_OUTPUT - fi - if [[ ${{ github.ref }} == *"nodejs"* ]]; then - echo LANGUAGE="nodejs" >> $GITHUB_OUTPUT - fi - - name: Get release version id: get_release_version run: |