Skip to content

new-manifest-detected #180

new-manifest-detected

new-manifest-detected #180

# This workflow runs when a new manifest is detected by cron
name: New Manifest Detected
on:
repository_dispatch:
types: [new-manifest-detected]
# on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout - D2AI
uses: actions/checkout@v2.3.4
with:
path: "d2ai"
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.4.2"
- name: Install Environment (D2AI)
working-directory: d2ai
run: poetry install --no-dev
- name: Update D2AI with new manifest information
uses: nick-invision/retry@v2.0.0
with:
timeout_minutes: 2
max_attempts: 3
command: cd d2ai && poetry run python getManifest.py
env:
API_KEY: ${{ secrets.API_KEY }}
- name: Generate new D2AI information
working-directory: d2ai
run: poetry run python script.py
env:
LOG_LEVEL: "SUCCESS"
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }}
- name: Check for new files (D2AI)
id: D2AI-porcelain
working-directory: d2ai
run: echo ::set-output name=porcelain::"$(git status --porcelain)"
- name: Create Pull Request (D2AI)
if: steps.D2AI-porcelain.outputs.porcelain
uses: peter-evans/create-pull-request@v3.4.1
with:
path: "d2ai"
token: ${{ secrets.PAT }}
commit-message: D2 Manifest Bot - Update All - Manifest v${{ github.event.client_payload.config.env.MANIFEST_VERSION }}
committer: D2manifest-Bot <1605206150tq@gmail.com>
title: "[D2 Manifest Bot] Manifest Update"
body: |
Manifest Update
- Update All - Manifest v${{ github.event.client_payload.config.env.MANIFEST_VERSION }}
- Auto-generated by [D2 Manifest Bot][1]
[1]: https://github.com/Tian-que/py-d2-additional-info
branch: d2ai-manifest