Update edge image #2918
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update edge image | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.REPO_SCOPED_TOKEN }} | |
- name: Fetch release version | |
id: fetch-release | |
run: | | |
export PS3NETSRV_VERSION=$(curl -sL https://api.github.com/repos/aldostools/webMAN-MOD/releases/latest | \ | |
jq -r '.assets[] | select(.name | startswith("ps3netsrv")) | .name' | \ | |
sed -e 's/ps3netsrv_\(.*\)\.zip/\1/') | |
if [ -n "$PS3NETSRV_VERSION" ]; then | |
echo "Found ps3netsrv release $PS3NETSRV_VERSION" | |
echo "Updated APP_VERSION with $PS3NETSRV_VERSION in .github/workflows/docker-publish.yml" | |
sed -ri "s/^(\s*)(APP_VERSION\s*:\s*.*\s*$)/\1APP_VERSION: \"$PS3NETSRV_VERSION\"/" .github/workflows/docker-publish.yml | |
echo ::set-output name=version::$PS3NETSRV_VERSION | |
fi | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") | |
- name: Commit latest release version | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --global user.name 'shawly' | |
git config --global user.email '[email protected]' | |
git commit -am "chore: update ps3netsrv to ${{ steps.fetch-release.outputs.version }}" | |
git push |