From 49d44cdcfb7f5fe994d132033fa37e2cc8e1b47b Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 23 Feb 2021 15:03:33 +0200 Subject: [PATCH 1/2] chore: fix auto-approve workflow Sadly there is no way to pass an array literal in workflow expressions (see [1]). [1]: https://github.community/t/passing-an-array-literal-to-contains-function-causes-syntax-error/17213 --- .github/workflows/auto-approve.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index d36f6255bbc7d..e9c0827d73b2c 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -7,7 +7,11 @@ jobs: auto-approve: if: > contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') && - contains(['aws-cdk-automation', 'dependabot[bot]', 'dependabot-preview[bot]'], github.event.pull_request.user.login) + ( + github.event.pull_request.user.login == 'aws-cdk-automation' + || github.event.pull_request.user.login == 'dependabot[bot]' + || github.event.pull_request.user.login == 'dependabot-preview[bot]' + ) runs-on: ubuntu-latest steps: - uses: hmarr/auto-approve-action@v2.0.0 From 8751fe003d31ea361dccd8c316f922be0f30f754 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 23 Feb 2021 15:04:02 +0200 Subject: [PATCH 2/2] Update auto-approve.yml --- .github/workflows/auto-approve.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index e9c0827d73b2c..81bd372dfb3ed 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -7,11 +7,9 @@ jobs: auto-approve: if: > contains(github.event.pull_request.labels.*.name, 'pr/auto-approve') && - ( - github.event.pull_request.user.login == 'aws-cdk-automation' + (github.event.pull_request.user.login == 'aws-cdk-automation' || github.event.pull_request.user.login == 'dependabot[bot]' - || github.event.pull_request.user.login == 'dependabot-preview[bot]' - ) + || github.event.pull_request.user.login == 'dependabot-preview[bot]') runs-on: ubuntu-latest steps: - uses: hmarr/auto-approve-action@v2.0.0