Skip to content

Update-Core-Commit

Update-Core-Commit #32

name: Update-Core-Commit
on:
# Currently this workflow only runs when triggered manually. Perhaps we can set it up to run when a tag is pushed. Or when a release is made. Or that it could create a release, on a release it can create a tag?
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
branch:
description: "Use main branch for regular releases, legacy-support for 1.8x fixes."
required: false
type: choice
default: "main"
options:
- "main"
- "legacy-support"
jobs:
tasks:
name: Update core commit
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
# Sets up python3
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Run bump script
run: |
echo "Updating core commit"
python scripts/fetch_core_commit.py
echo "Finished"
- name: setup git config
run: |
# setup the username and email.
git config user.name "${{ github.actor }} via GitHub Actions"
git config user.email "${{ github.actor }}@github_actions.no_reply"
- name: commit core update via pr
run: |
git checkout -b core-commit-update
git add pretext/__init__.py
git commit -m "update to latest core commit"
git push --set-upstream origin core-commit-update
gh pr create --fill
gh pr merge -s -d -t "update to latest core commit"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}