Skip to content

TAA Improvement

TAA Improvement #1630

Workflow file for this run

on: issue_comment
name: Labelize
jobs:
#----------------------------------------------------------------------------
# Labelize
#----------------------------------------------------------------------------
labelize:
name: Labelize
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '\ci')
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.F3D_CI_LABEL }}
steps:
- name: Analyze comment
shell: bash
run: |
label="${{github.event.comment.body}}"
label=${label#* }
label=${label%% *}
echo "F3D_LABEL_COMMENT=$label" >> $GITHUB_ENV
- name: Add ack reaction
uses: GrantBirki/[email protected]
with:
comment-id: ${{ github.event.comment.id }}
reactions: eyes
- name: Add label on PR
if: ${{!contains(env.F3D_LABEL_COMMENT, '-')}}
shell: bash
run: gh issue edit ${{ github.event.issue.number }} --add-label "ci:${{env.F3D_LABEL_COMMENT}}"
- name: Remove label on PR
if: contains(env.F3D_LABEL_COMMENT, '-')
shell: bash
run: |
label="${{env.F3D_LABEL_COMMENT}}"
label=${label#*-}
gh issue edit ${{ github.event.issue.number }} --remove-label "ci:$label"
- name: Create comment for invalid command
if: failure()
uses: GrantBirki/[email protected]
with:
body: |
> ${{github.event.comment.body}}
❌ Invalid CI command "${{env.F3D_LABEL_COMMENT}}"