BYOND version check #8829
This file contains hidden or 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
| name: BYOND version check | |
| on: | |
| schedule: | |
| - cron: '*/10 * * * *' # Every 10 minutes | |
| permissions: | |
| contents: write # required to push to master | |
| jobs: | |
| version_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get latest version number | |
| run: | | |
| set -e | |
| set -o pipefail | |
| curl --fail -s https://www.byond.com/download/version.txt | awk -F. '{print "BYOND_MAJOR_VERSION="$1"\nBYOND_MINOR_VERSION="$2}' > buildByond.conf | |
| - name: Check for buildByond.conf changes | |
| id: check_diff | |
| run: | | |
| if ! git diff --quiet buildByond.conf; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push if changed | |
| if: steps.check_diff.outputs.changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add buildByond.conf | |
| git commit -m "Automated update $(cat buildByond.conf | tr '\n' ' ')" | |
| git push origin master | |
| - name: Trigger unit test workflow | |
| if: steps.check_diff.outputs.changed == 'true' | |
| uses: peter-evans/repository-dispatch@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| repository: ${{ github.repository }} | |
| event-type: byond-updated | |
| client-payload: '{"fromupdate": "true"}' | |