Fixes PR thank you msg. from potentially tagging the PR author twice #54982
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto label failed preview deploys | |
permissions: | |
pull-requests: write | |
on: | |
issue_comment: | |
types: | |
- created | |
- edited | |
jobs: | |
auto-label-deploy-failed: | |
runs-on: ubuntu-latest | |
if: | | |
github.repository == 'ohcnetwork/care_fe' && github.event.issue.pull_request && | |
contains(github.event.comment.body, 'Deploy Preview') | |
steps: | |
- name: Add 'Deploy-Failed' | |
if: contains(github.event.comment.body, 'failed') | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ["Deploy-Failed"] | |
}) | |
- name: Remove 'Deploy-Failed' label | |
if: contains(github.event.comment.body, 'ready') | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.removeLabel({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ["Deploy-Failed"] | |
}) |