This repository has been archived by the owner on Nov 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters