From 9979c1fa8c06bc4eb2281d4d1b56961db17a410e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Tue, 21 Nov 2023 17:21:33 +0100 Subject: [PATCH] Update check_application_document.yml (#2122) --- .../workflows/check_application_document.yml | 24 --------------- .github/workflows/private-labeler.yml | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/private-labeler.yml diff --git a/.github/workflows/check_application_document.yml b/.github/workflows/check_application_document.yml index 78c841442ee..ddb8f7574c9 100644 --- a/.github/workflows/check_application_document.yml +++ b/.github/workflows/check_application_document.yml @@ -6,30 +6,6 @@ on: types: [opened, synchronize] jobs: - discussion_private: - if: | - github.event.action == 'opened' && - contains(github.event.pull_request.body, 'Project Abstract') && ( - !contains(github.event.pull_request.body, '- [ ] I prefer the discussion') || - ( - contains(github.event.pull_request.body, '- [ ] I prefer the discussion') && - !contains(github.event.pull_request.body, '@_______:matrix.org') - ) - ) - runs-on: ubuntu-latest - steps: - - name: Add 'discussion private' label if the application is private - uses: actions/github-script@v6 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ["discussion private"] - }) - get_filename: if: contains(github.event.pull_request.body, 'Project Abstract') runs-on: ubuntu-latest diff --git a/.github/workflows/private-labeler.yml b/.github/workflows/private-labeler.yml new file mode 100644 index 00000000000..6d0d704d228 --- /dev/null +++ b/.github/workflows/private-labeler.yml @@ -0,0 +1,30 @@ +name: Check for private discussion + +on: + workflow_dispatch: + pull_request: + types: [opened, edited] + +jobs: + discussion_private: + if: | + contains(github.event.pull_request.body, 'Project Abstract') && ( + !contains(github.event.pull_request.body, '- [ ] I prefer the discussion') || + ( + contains(github.event.pull_request.body, '- [ ] I prefer the discussion') && + !contains(github.event.pull_request.body, '@_______:matrix.org') + ) + ) + runs-on: ubuntu-latest + steps: + - name: Add 'discussion private' label if the application is private + uses: actions/github-script@v6 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["discussion private"] + })