diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-10-19 20:07:01 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-19 09:07:01 +0000 |
| commit | 39655967d477e2737a62c8a2db6d6b04d5240958 (patch) | |
| tree | 3ea28ae853ebf3dca60071da52313d7a6edfe67f /.github/workflows | |
| parent | 6511352fe6f0aef97a7cac0ce4ce931d15d1b4af (diff) | |
| download | NotEnoughUpdates-REPO-39655967d477e2737a62c8a2db6d6b04d5240958.tar.gz NotEnoughUpdates-REPO-39655967d477e2737a62c8a2db6d6b04d5240958.tar.bz2 NotEnoughUpdates-REPO-39655967d477e2737a62c8a2db6d6b04d5240958.zip | |
Github action to update museum data (#1411)
* Github action to update museum data
* Throw error on fail
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/update-museum.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/update-museum.yml b/.github/workflows/update-museum.yml new file mode 100644 index 00000000..29ffbf49 --- /dev/null +++ b/.github/workflows/update-museum.yml @@ -0,0 +1,47 @@ +name: Update Museum Data + +on: + push: + branches: + - master + +jobs: + update-data: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install requests library + run: python -m pip install requests + + - name: Run Python script + run: python .github/scripts/updateMuseum.py + + - name: Commit and push changes + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "github-actions@github.com" + git add constants/museum.json + if git diff-index --quiet HEAD --; then + echo "No changes to commit" + exit 0 + fi + git commit -m "Update museum data from Hypixel API" + git push --force origin HEAD:bot/museum + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: bot/museum + base: master + title: "Automated Update of Museum Data" + body: "This pull request contains the latest museum data sourced from the Hypixel API." + labels: "automated update" |
