From d9f2b8f75f93543127583ac1eacc50efd7e89bae Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 24 Dec 2023 08:45:07 +0000 Subject: [PATCH 1/4] Don't run reviewer lottery from bots --- .github/workflows/reviewer_lottery.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/reviewer_lottery.yml b/.github/workflows/reviewer_lottery.yml index 2edbc9b59..5cd52ff8f 100644 --- a/.github/workflows/reviewer_lottery.yml +++ b/.github/workflows/reviewer_lottery.yml @@ -6,7 +6,14 @@ on: jobs: test: runs-on: ubuntu-latest + if: github.actor != 'dependabot[bot]' && github.actor != 'mergify[bot]' steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" + echo "The GitHub Actor's username is: $GITHUB_ACTOR" - uses: actions/checkout@v4 - uses: uesteibar/reviewer-lottery@v3 with: From b41223be64c4da986bf16a994e5804fb81ca8236 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 24 Dec 2023 08:57:19 +0000 Subject: [PATCH 2/4] Add own context testing workflow --- .github/workflows/context_testing.yml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/context_testing.yml diff --git a/.github/workflows/context_testing.yml b/.github/workflows/context_testing.yml new file mode 100644 index 000000000..60d3e9807 --- /dev/null +++ b/.github/workflows/context_testing.yml @@ -0,0 +1,33 @@ +name: Context testing +on: + pull_request_target: + types: [opened, ready_for_review, reopened] + +jobs: + dump_contexts_to_log: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump job context + env: + JOB_CONTEXT: ${{ toJson(job) }} + run: echo "$JOB_CONTEXT" + - name: Dump steps context + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + - name: Dump runner context + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "$RUNNER_CONTEXT" + - name: Dump strategy context + env: + STRATEGY_CONTEXT: ${{ toJson(strategy) }} + run: echo "$STRATEGY_CONTEXT" + - name: Dump matrix context + env: + MATRIX_CONTEXT: ${{ toJson(matrix) }} + run: echo "$MATRIX_CONTEXT" From ff03827094d8fdfbd8fc02f107db1101b47fde15 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 24 Dec 2023 08:57:31 +0000 Subject: [PATCH 3/4] add braces to if: --- .github/workflows/reviewer_lottery.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reviewer_lottery.yml b/.github/workflows/reviewer_lottery.yml index 5cd52ff8f..c0852a801 100644 --- a/.github/workflows/reviewer_lottery.yml +++ b/.github/workflows/reviewer_lottery.yml @@ -6,7 +6,7 @@ on: jobs: test: runs-on: ubuntu-latest - if: github.actor != 'dependabot[bot]' && github.actor != 'mergify[bot]' + if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'mergify[bot]' }} steps: - name: Dump GitHub context env: From 185b6576980390cb2b85266c8f2c512606aaaf6c Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 24 Dec 2023 08:59:01 +0000 Subject: [PATCH 4/4] Run always --- .github/workflows/context_testing.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/context_testing.yml b/.github/workflows/context_testing.yml index 60d3e9807..ada55b7af 100644 --- a/.github/workflows/context_testing.yml +++ b/.github/workflows/context_testing.yml @@ -1,7 +1,6 @@ name: Context testing on: - pull_request_target: - types: [opened, ready_for_review, reopened] + pull_request: jobs: dump_contexts_to_log: