From 02eeb88fb1b6140af01f9e1a3b1b260555a75d26 Mon Sep 17 00:00:00 2001 From: m-vdb Date: Fri, 6 Oct 2023 09:42:50 +0200 Subject: [PATCH 1/2] dont run roberto workflow on forks --- .github/workflows/automatic-release-to-main-merger.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automatic-release-to-main-merger.yml b/.github/workflows/automatic-release-to-main-merger.yml index bb267f031556..ddaca58bb348 100644 --- a/.github/workflows/automatic-release-to-main-merger.yml +++ b/.github/workflows/automatic-release-to-main-merger.yml @@ -26,7 +26,9 @@ jobs: runs-on: ubuntu-22.04 # only run this workflow if a pull request has been merged - if: github.event.pull_request.merged == true + # don't run this workflow on pull request from forks, permissions will be missing anyway + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflows-in-forked-repositories + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == 'RasaHQ/rasa' steps: - name: Checkout git repository 🕝 From 800089ea54ea78db29e98b524e9ee8fc11813294 Mon Sep 17 00:00:00 2001 From: m-vdb Date: Fri, 6 Oct 2023 10:40:47 +0200 Subject: [PATCH 2/2] send Slack notification on failure --- .../automatic-release-to-main-merger.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/automatic-release-to-main-merger.yml b/.github/workflows/automatic-release-to-main-merger.yml index ddaca58bb348..6ed4cca20af8 100644 --- a/.github/workflows/automatic-release-to-main-merger.yml +++ b/.github/workflows/automatic-release-to-main-merger.yml @@ -70,14 +70,6 @@ jobs: with: branch: ${{ steps.get-branch-name.outputs.new_branch }} - - name: Notify Slack if creating a new branch failed 💬 - if: ${{ failure() && steps.create-new-branch.conclusion == 'failure' }} - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_INFRASTRUCTURE_SQUAD_MONITORS_WEBHOOK_URL }} - uses: Ilshidur/action-slack@689ad44a9c9092315abd286d0e3a9a74d31ab78a - with: - args: "🚨 There was a problem with creating a new branch containing commits from the ${{ env.RELEASE_BRANCH }} release branch. Check out the Github action: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - - name: Open pull request ☄️ if: ${{ steps.create-new-branch.conclusion == 'success' }} uses: repo-sync/pull-request@7e79a9f5dc3ad0ce53138f01df2fad14a04831c5 @@ -111,11 +103,11 @@ jobs: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Notify Slack when closing of outdated merge-PRs failed 💬 - if: ${{ failure() && steps.close-outdated-release-merge-prs.conclusion == 'failure'}} + - name: Notify Slack on failure 💬 + if: failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_INFRASTRUCTURE_SQUAD_MONITORS_WEBHOOK_URL }} uses: Ilshidur/action-slack@689ad44a9c9092315abd286d0e3a9a74d31ab78a with: - args: "🚨 There was a problem with closing outdated release-merge-PRs of the ${{ env.RELEASE_BRANCH }} release branch. Check out the Github action: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} \ - These release-merge-PRs are currently open: https://github.com/${{ github.repository }}/pulls?q=is%3Aopen+label%3A${{ env.LABEL_TYPE }}+head%3Amerge-${{ steps.get-branch-name.outputs.release_branch }}-main" + args: "🚨 There was a problem with porting changes from ${{ env.RELEASE_BRANCH }} to the `main` branch. \ + Check out the Github action: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"