Skip to content

Commit

Permalink
Merge pull request #1 from flathub/new-br
Browse files Browse the repository at this point in the history
[+] add workflow updater
  • Loading branch information
grisha765 authored Aug 11, 2024
2 parents ed4551b + 1ef9304 commit 3b7e42a
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/update_manifest_beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Update Cataclysm-DDA Commit in Manifest

on:
schedule:
- cron: '0 */4 * * *'
workflow_dispatch:

jobs:
update-manifest:
runs-on: ubuntu-latest

steps:
- name: Checkout this repository
uses: actions/checkout@v2
with:
ref: beta

- name: Get latest commit and tag from the latest pre-release
run: |
RELEASE_DATA=$(curl -s https://api.github.com/repos/CleverRaven/Cataclysm-DDA/releases | jq -r '[.[] | select(.prerelease == true)] | .[0]')
# Извлекаем тег из данных релиза
LATEST_TAG=$(echo "$RELEASE_DATA" | jq -r '.tag_name')
echo "Latest tag is $LATEST_TAG"
# Извлекаем коммит из данных релиза
LATEST_COMMIT=$(echo "$RELEASE_DATA" | jq -r '.target_commitish')
echo "Latest commit is $LATEST_COMMIT"
echo "LATEST_COMMIT=$LATEST_COMMIT" >> $GITHUB_ENV
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Update manifest with the latest commit
run: |
sed -i "s/commit: \".*\"/commit: \"$LATEST_COMMIT\"/" org.cataclysmdda.CataclysmDDA.yml
- name: Set up Git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
- name: Commit and push changes with tag in message
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add org.cataclysmdda.CataclysmDDA.yml
git commit -m "Update manifest with latest Cataclysm-DDA commit $LATEST_COMMIT ($LATEST_TAG)"
git push origin beta

0 comments on commit 3b7e42a

Please sign in to comment.