From c48ea4cf11b825b494393937eb8eb0c7049277ee Mon Sep 17 00:00:00 2001 From: Corneil du Plessis Date: Tue, 1 Nov 2022 21:07:49 +0200 Subject: [PATCH] [GitHub Actions] Add action --- .github/actions/is_there_only_one/action.yml | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/actions/is_there_only_one/action.yml diff --git a/.github/actions/is_there_only_one/action.yml b/.github/actions/is_there_only_one/action.yml new file mode 100644 index 00000000..d4ad6c5d --- /dev/null +++ b/.github/actions/is_there_only_one/action.yml @@ -0,0 +1,21 @@ +name: 'There can be only one' +description: 'Checks that this is only current workflow running' +inputs: + github_token: + description: 'GITHUB_TOKEN' + required: true + retries: + description: 'Retries' + required: false + default: '1' +runs: + using: "composite" + steps: + - name: 'Check active' + shell: bash + env: + GH_TOKEN: '${{ inputs.github_token }}' + run: | + ALLOW_HOUSEKEEPING=$(./scripts/is_there_only_one.sh "${{ github.workflow }}" ${{ inputs.retries }}) + echo "ALLOW_HOUSEKEEPING=$ALLOW_HOUSEKEEPING" >> $GITHUB_ENV + echo "::notice ::ALLOW_HOUSEKEEPING=$ALLOW_HOUSEKEEPING"