Fix update check

This commit is contained in:
Xiaonan Shen 2020-05-31 21:57:41 -07:00
parent 2c9ef4cd8d
commit b5fb47d96d
No known key found for this signature in database
GPG Key ID: 211BF560D12417F5
2 changed files with 5 additions and 16 deletions

View File

@ -12,12 +12,12 @@ on:
- cron: '0 0 * * *' # runs everyday at midnight - cron: '0 0 * * *' # runs everyday at midnight
jobs: jobs:
build: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@master uses: actions/checkout@master
with:
token: ${{ secrets.PERSONAL_TOKEN }}
- name: Check Update - name: Check Update
run: bash update-check.sh run: bash update-check.sh
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}

View File

@ -2,8 +2,6 @@
set -ex set -ex
REMOTE_REPO="https://${GITHUB_ACTOR}:${PERSONAL_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
VERSION=`cat VERSION` VERSION=`cat VERSION`
JSON_CONTENT=$(curl -q https://protonmail.com/download/current_version_linux.json) JSON_CONTENT=$(curl -q https://protonmail.com/download/current_version_linux.json)
@ -14,21 +12,12 @@ if [[ $VERSION != $CURR_VERSION ]]; then
echo "New release found: ${CURR_VERSION}" echo "New release found: ${CURR_VERSION}"
# bump up to new release # bump up to new release
cat ${CURR_VERSION} > VERSION echo ${CURR_VERSION} > VERSION
# commit # commit
git config --local user.email "actions@github.com" git config --local user.email "actions@github.com"
git config --local user.name "Github Action" git config --local user.name "Github Action"
git add VERSION git add VERSION
git commit -m "Bump version to ${CURR_VERSION}" --author="Xiaonan Shen <s@sxn.dev>" git commit -m "Bump version to ${CURR_VERSION}" --author="Xiaonan Shen <s@sxn.dev>"
git push
# push
git push "${REMOTE_REPO}" master
# # trigger actions
# curl -H "Accept: application/vnd.github.everest-preview+json" \
# -H "Authorization: token ${PERSONAL_TOKEN}" \
# --request POST \
# --data '{"event_type": "build"}' \
# https://api.github.com/repos/${GITHUB_REPOSITORY}/dispatches
fi fi