Skip to content

Autocreate robot profile if none exists #19

Autocreate robot profile if none exists

Autocreate robot profile if none exists #19

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
jobs:
create-robot-profile-if-not-exists:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
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 Git Pull
run: "git pull --rebase"
- name: Run Script
run: python createRobotProfile.py
# - name: Commit Files
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: Autocreate Robot Profile for ${{ steps.date.outputs.date }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Automatically Create Robot Profile
title: Create a robot profile for ${{ steps.date.outputs.date }}
branch: robot-profile-${{ steps.date.outputs.date }}
base: main