atlassian-json/.github/workflows/json-master.yml

83 lines
2.5 KiB
YAML
Raw Normal View History

2021-01-15 00:55:17 +03:00
name: json-updater
on:
pull_request:
branches:
- '*'
tags:
- '*'
push:
branches:
- 'master'
schedule:
2021-01-15 01:06:13 +03:00
- cron: '0 0-23 * * *' # every hour
2021-01-15 00:55:17 +03:00
jobs:
2021-01-15 01:13:58 +03:00
update:
2021-01-15 00:55:17 +03:00
runs-on: ubuntu-20.04
steps:
2021-01-17 04:13:54 +03:00
2021-01-15 01:18:42 +03:00
- name: Checkout repository
2021-01-17 03:47:24 +03:00
uses: actions/checkout@v2
2021-01-17 03:46:33 +03:00
with:
ref: ${{ github.head_ref }}
2021-01-15 01:06:13 +03:00
2021-01-15 01:18:42 +03:00
- name: Configure git
run: |
2021-01-15 01:13:58 +03:00
cd json-backups
2021-01-15 01:06:13 +03:00
ls -las
git config --global user.name "github-actions[bot]"
git config --global user.email "stamepicmorg@users.noreply.github.com"
2021-01-15 01:18:42 +03:00
- name: Update files
2021-01-17 02:36:23 +03:00
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
2021-01-15 01:18:42 +03:00
run: |
2021-01-15 01:06:13 +03:00
cd json-backups
ls -las
./update.sh
2021-01-17 02:41:36 +03:00
cd ..
2021-01-17 03:38:48 +03:00
2021-01-17 04:13:54 +03:00
- name: Commit changes
2021-01-17 04:34:18 +03:00
uses: stefanzweifel/git-auto-commit-action@v4
2021-01-17 03:38:48 +03:00
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
2021-05-18 22:27:25 +03:00
# - name: "Notify if changes have been detected"
# if: steps.auto-commit-action.outputs.changes_detected == 'true'
# run: |
# echo "Changes! Notify!"
# 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
2021-01-17 03:34:45 +03:00
2021-05-18 22:27:25 +03:00
# - name: "Tag new version if changes have been detected"
# if: steps.auto-commit-action.outputs.changes_detected == 'true'
# id: "tag"
# uses: "anothrNick/github-tag-action@1.30.0"
# env:
# GITHUB_TOKEN: ${{ secrets.GHT }}
# WITH_V: false
# RELEASE_BRANCHES: main
# DEFAULT_BUMP: patch
2021-01-17 03:34:45 +03:00
2021-05-18 22:27:25 +03:00
# - name: "Create release if changes have been detected"
# if: steps.auto-commit-action.outputs.changes_detected == 'true'
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GHT }}
# with:
# tag_name: ${{ steps.tag.outputs.new_tag }}
# release_name: ${{ steps.tag.outputs.new_tag }}
# commitish: main
# body: "Update stubs"
2021-01-17 03:24:38 +03:00
2021-05-18 22:27:25 +03:00
# - name: "Do nothing if no changes have been detected"
# if: steps.auto-commit-action.outputs.changes_detected == 'false'
# run: echo "No Changes!"
2021-01-17 03:24:38 +03:00