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

80 lines
2.0 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-15 01:24:48 +03:00
- name: Get current date
id: date
2021-01-15 01:29:45 +03:00
run: echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
2021-01-15 01:24:48 +03:00
2021-01-15 01:18:42 +03:00
- name: Checkout repository
uses: actions/checkout@v2
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:03:09 +03:00
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply changes
2021-01-17 03:01:31 +03:00
- name: "Run if changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "Changes!"
- name: "Run if no changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: echo "No Changes!"
# git add .
# git commit -am "Atlassian JSON autoupdated"
# git push
# exit 0
2021-01-17 02:57:19 +03:00
# - name: Commit and push changes
# uses: devops-infra/action-commit-push@master
# with:
# github_token: ${{ secrets.GHT }}
# commit_message: Atlassian JSON updated
#
2021-01-15 01:35:09 +03:00
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GHT }}
# with:
# tag_name: ${{ env.RELEASE_DATE }}
# release_name: Release ${{ env.RELEASE_DATE }}
# body: |
# Changes in this Release
# - Atlassian JSON updated ${{ env.RELEASE_DATE }}
# draft: false
# prerelease: false