mirror of
https://github.com/EpicMorg/atlassian-json.git
synced 2025-02-10 21:58:55 +03:00
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
name: json-updater
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
tags:
|
|
- '*'
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
schedule:
|
|
- cron: '0 0-23 * * *' # every hour
|
|
|
|
jobs:
|
|
update:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Get current date
|
|
id: date
|
|
run: echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Configure git
|
|
run: |
|
|
cd json-backups
|
|
ls -las
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "stamepicmorg@users.noreply.github.com"
|
|
|
|
- name: Update files
|
|
env:
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
run: |
|
|
cd json-backups
|
|
ls -las
|
|
./update.sh
|
|
cd ..
|
|
- name: Commit changes
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
commit_message: Atlassian JSON Autoupdated
|
|
commit_user_name: stamepicmorg # defaults to "GitHub Actions"
|
|
commit_user_email: stamepicmorg@users.noreply.github.com # defaults to "actions@github.com"
|
|
commit_author: stamepicmorg <stamepicmorg@users.noreply.github.com> # defaults to author of the commit that triggered the run
|
|
- name: "Run if changes have been detected"
|
|
if: steps.auto-commit-action.outputs.changes_detected == 'true'
|
|
run: |
|
|
echo "Changes!"
|
|
curl -s --data-urlencode -X POST ${{ secrets.TLG_URL }} -d chat_id=${{ secrets.TLG_CHAT }} -d text="${{ secrets.TLG_TEXT }}" -d "parse_mode=HTML" >> /dev/null
|
|
|
|
- name: "Run if no changes have been detected"
|
|
if: steps.auto-commit-action.outputs.changes_detected == 'false'
|
|
run: echo "No Changes!" |