Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Commit

Permalink
auto update script
Browse files Browse the repository at this point in the history
  • Loading branch information
watzon committed Dec 19, 2023
1 parent 0895bca commit df2e72d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/bot-api-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Github workflow to update the code when the bot API is updated.
# Runs every day, and can be manually triggered.
# On trigger, runs the generate script at `scripts/generate.cr`, commits the changes (if any) to the `develop` branch,
# and opens a pull request to merge the changes into `master`.

name: Update code
on:
workflow_dispatch: {} # Allow manual triggering
schedule:
- cron: "0 0 * * *"
jobs:
update:
runs-on: ubuntu-latest
strategy:
matrix:
crystal-version: [1.10.1]
steps:
- uses: actions/checkout@v2
with:
ref: develop
- uses: oprypin/install-crystal@v1
with:
crystal: ${{ matrix.crystal-version }}
- name: Install dependencies
run: shards install
- name: Generate code
id: generate
run: crystal scripts/generate.cr
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "Chris Watson"
git add .
git commit -am "bot api update"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: develop
- name: Create pull request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "bot api update"
title: "bot api update"
body: ${{ steps.generate.outputs.output }}
branch: develop
base: master
2 changes: 1 addition & 1 deletion .github/workflows/crystal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
crystal-version: [1.6.2]
crystal-version: [1.10.1]

steps:
- uses: actions/checkout@v2
Expand Down

0 comments on commit df2e72d

Please sign in to comment.