From b67cf6fdcab825031e65330b343d01e764bbe8cc Mon Sep 17 00:00:00 2001 From: "Paul S. Schweigert" Date: Tue, 24 Sep 2024 17:57:52 -0400 Subject: [PATCH] disable wg review action Signed-off-by: Paul S. Schweigert --- .github/workflows/toc-review-reminder.yaml | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/toc-review-reminder.yaml diff --git a/.github/workflows/toc-review-reminder.yaml b/.github/workflows/toc-review-reminder.yaml new file mode 100644 index 00000000..c22ae0b3 --- /dev/null +++ b/.github/workflows/toc-review-reminder.yaml @@ -0,0 +1,59 @@ +# Copyright 2024 The Knative Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 'TOC review reminder' + +on: + workflow_dispatch: + schedule: ## At 09:00 on Mondays + - cron: 0 9 * * MON + +jobs: + remind: + name: toc-review-reminder + runs-on: 'ubuntu-latest' + + steps: + - name: checkout TOC-REVIEW.schedule + uses: actions/checkout@v4 + with: + repository: knative/community + sparse-checkout: | + mechanics/TOC-REVIEW.schedule + sparse-checkout-cone-mode: false + + - name: check who is scheduled this week + id: schedule + run: | + SLACK_MSG="NONE" + SCHED=$(cat mechanics/TOC-REVIEW.schedule | grep $(date --date="next wednesday" +%F) || true) + if [[ $SCHED ]]; then + DATE=$(echo $SCHED | cut -d '|' -f 1 | xargs) + WG=$(echo $SCHED | cut -d '|' -f 2 | xargs) + MEMBERS=$(echo $SCHED | cut -d '|' -f 3 | xargs) + SLACK_MSG="The $WG is up for TOC review on $DATE. $MEMBERS" + fi + echo "result=${SLACK_MSG}" >> "$GITHUB_OUTPUT" + + - name: Post reminder to Slack + if: steps.schedule.outputs.result != 'NONE' + uses: rtCamp/action-slack-notify@v2.2.1 + env: + SLACK_ICON: http://github.com/knative.png?size=48 + SLACK_USERNAME: github-actions + SLACK_TITLE: TOC review reminder + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: 'true' + SLACK_CHANNEL: 'knative-contributors' + SLACK_MESSAGE: ${{ steps.schedule.outputs.result }}