Skip to content

Commit 0934ec4

Browse files
Panquesito7github-actions[bot]
andauthored
feat: label PR on CI fail (WIP) (TheAlgorithms#2455)
* feat: label PR on CI fail * updating DIRECTORY.md --------- Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
1 parent 4f4585d commit 0934ec4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/awesome_workflow.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,26 @@ jobs:
9494
name: Compile checks
9595
runs-on: ${{ matrix.os }}
9696
needs: [MainSequence]
97+
permissions:
98+
pull-requests: write
9799
strategy:
98100
matrix:
99101
os: [ubuntu-latest, windows-latest, macOS-latest]
100102
steps:
101103
- uses: actions/checkout@v3
102104
with:
103105
submodules: true
104-
- run: cmake -B ./build -S .
105-
- run: cmake --build build
106+
- run: |
107+
cmake -B ./build -S .
108+
cmake --build build
109+
- name: Label on PR fail
110+
uses: actions/github-script@v6
111+
if: ${{ failure() && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }}
112+
with:
113+
script: |
114+
github.rest.issues.addLabels({
115+
issue_number: context.issue.number,
116+
owner: context.repo.owner,
117+
repo: context.repo.repo,
118+
labels: ['automated tests are failing']
119+
})

0 commit comments

Comments
 (0)