Skip to content

Autocreate robot profile if none exists #34

Autocreate robot profile if none exists

Autocreate robot profile if none exists #34

name: Autocreate robot profile if none exists
on:
schedule:
- cron: '0 5 1 4 *' # runs at 05:00 on the first day of April, right after the Season ends
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
actions: write
jobs:
create-robot-profile-if-not-exists:
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y')"
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: main
clean: false
- name: Run Script
run: python createRobotProfile.py
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Automatically Create Robot Profile
title: Create a robot profile for ${{ steps.date.outputs.date }}
branch: robot-profile-${{ steps.date.outputs.date }}
- name: Fire CI-CD Action
uses: benc-uk/workflow-dispatch@v1
with:
ref: ${{ steps.cpr.outputs.pull-request-number }}/merge
workflow: 73393124
token: ${{ secrets.github_token }}