From b0f94e534d7bcc573b8ab4b7e9feda1c9f31cfd3 Mon Sep 17 00:00:00 2001 From: SMITH <1695515+ms609@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:31:49 +0000 Subject: [PATCH] if !fedora --- .github/workflows/rhub.yaml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml index 884a5fac..a31e7f8f 100644 --- a/.github/workflows/rhub.yaml +++ b/.github/workflows/rhub.yaml @@ -51,18 +51,14 @@ jobs: image: ${{ matrix.config.container }} steps: - - name: Install sudo (Linux) - if: runner.os == 'Linux' + - name: Check distribution + run: echo "::set-output name=distribution::$(awk -F= '/^ID=/{print $2}' /etc/os-release)" + id: check_distribution + - name: Run step only on Fedora + if: ${{ steps.check_distribution.outputs.distribution != 'fedora' }} run: | - . /etc/os-release - echo $ID - if [ "$ID" = "fedora" ]; then - yum install sudo - fi - if command -v apt-get &> /dev/null - then - apt-get install sudo - fi + echo steps.check_distribution.outputs.distribution + apt-get install sudo - uses: r-lib/actions/setup-pandoc@v2 - uses: r-hub/rhub2/actions/rhub-checkout@v1 - uses: r-hub/rhub2/actions/rhub-platform-info@v1