From 85715555bc6d3f2900af1595149b2b38d699567b Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 4 Jun 2024 12:34:05 -0400 Subject: [PATCH] Testing some stuff Signed-off-by: Simo Sorce --- .github/workflows/test.yml | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b46b4a95 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,60 @@ +--- +name: Faux Scan + +on: + pull_request: + branches: ["main"] + types: + - synchronize + - labeled + +jobs: + on-labeled-pr: + if: ${{ contains(github.event.action, 'labeled') && contains(github.event.*.labels.*.name, 'covscan-ok') }} + name: Fail PR + runs-on: ubuntu-latest + steps: + - name: Fail Step + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" + false + + on-synchronize: + if: ${{ contains(github.event.action, 'synchronize') && contains(github.event.pull_request.labels.*.name, 'no-covscan') }} + name: Fail Again + runs-on: ubuntu-latest + steps: + - name: Fail Step + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" + false + + delabel: + if: ${{ contains(github.event.action, 'synchronize') && contains(github.event.pull_request.labels.*.name, 'covscan-ok') }} + name: Fail on changed files + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Check changed files + id: changed-sources + uses: tj-actions/changed-files@v44 + with: + files: | + src/** + - name: Fail on changed files + if: steps.changed-sources.outputs.any_changed == 'true' + run: | + false + + - name: Fail Step + env: + CONTEXT: ${{ toJson(steps.changed-sources.outputs) }} + run: | + echo "$CONTEXT" + false +