Skip to content

πŸš€ (TestFlight): Release beta apps #68

πŸš€ (TestFlight): Release beta apps

πŸš€ (TestFlight): Release beta apps #68

# Leka - iOS Monorepo
# Copyright APF France handicap
# SPDX-License-Identifier: Apache-2.0
name: Content - ChatGPT Curriculum Reviews
on:
pull_request:
types: [labeled]
jobs:
review_yaml:
name: Review YAML files
if: contains(github.event.label.name, 'content:review curriculums')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Review YAML files
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: python Tools/Content/content_chatgpt_review.py --content_type curriculum
- name: Post Github comment
id: post_github_comment
if: ${{ success() && env.CHATGPT_RESPONSES != ''}}
uses: marocchino/sticky-pull-request-comment@v2
with:
hide_and_recreate: true
hide_classify: "OUTDATED"
header: content_reviews_curriculum_chatgpt
message: |
# ChatGPT Curriculum Reviews
${{ env.CHATGPT_RESPONSES }}
- name: Post to a Slack channel
id: post_to_slack
if: ${{ success() && env.CHATGPT_RESPONSES != ''}}
uses: slackapi/[email protected]
with:
channel-id: "C9UGVSTGE"
slack-message: |
*New ChatGPT Curriculum Reviews*
https://github.com/leka/ios-monorepo/pull/${{ env.PR_NUMBER }}#issuecomment-${{ steps.post_github_comment.outputs.created_comment_id }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Remove label
if: always()
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { LABEL_NAME } = process.env
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: LABEL_NAME
})
env:
LABEL_NAME: ${{ github.event.label.name }}