Skip to content

Commit

Permalink
ci(flatpak): commit updated sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Belar committed Nov 20, 2024
1 parent 2e33299 commit 071078f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ on:
branches-ignore:
- main

permissions:
contents: write

env:
FLATPAK_SOURCES_PATH: ./build/flatpak/generated-sources.json
FLATPAK_SOURCES_COMMIT_MESSAGE: "build(flatpak): update generated sources"

jobs:
generate:
Expand All @@ -21,6 +25,16 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Generate resources
id: resources
run: |
mkdir -p $(dirname $FLATPAK_SOURCES_PATH)
flatpak-node-generator npm ./package-lock.json -o $FLATPAK_SOURCES_PATH
echo "flatpak-sources-changed=$(test -f $FLATPAK_SOURCES_PATH && git add -N $FLATPAK_SOURCES_PATH && (git diff --quiet --exit-code -- $FLATPAK_SOURCES_PATH || echo "true"))" >> $GITHUB_OUTPUT
- name: Commit build resources
if: ${{ steps.resources.outputs.flatpak-sources-changed == 'true' }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add $FLATPAK_SOURCES_PATH
git commit -m "$FLATPAK_SOURCES_COMMIT_MESSAGE"
git push

0 comments on commit 071078f

Please sign in to comment.