From 0934ec4a8a0c58143776b9e8e0faf1ccc2ea88ed Mon Sep 17 00:00:00 2001 From: David Leal Date: Fri, 19 May 2023 19:23:40 -0600 Subject: [PATCH] feat: label PR on CI fail (WIP) (#2455) * feat: label PR on CI fail * updating DIRECTORY.md --------- Co-authored-by: github-actions[bot] --- .github/workflows/awesome_workflow.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/awesome_workflow.yml b/.github/workflows/awesome_workflow.yml index 315629c98..c4c398cd9 100644 --- a/.github/workflows/awesome_workflow.yml +++ b/.github/workflows/awesome_workflow.yml @@ -94,6 +94,8 @@ jobs: name: Compile checks runs-on: ${{ matrix.os }} needs: [MainSequence] + permissions: + pull-requests: write strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] @@ -101,5 +103,17 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - run: cmake -B ./build -S . - - run: cmake --build build + - run: | + cmake -B ./build -S . + cmake --build build + - name: Label on PR fail + uses: actions/github-script@v6 + if: ${{ failure() && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }} + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['automated tests are failing'] + })