Skip to content

Commit

Permalink
fixup! Add automatic PR action
Browse files Browse the repository at this point in the history
  • Loading branch information
pganssle committed Sep 24, 2024
1 parent 04fcb58 commit 14d7cc2
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/check-for-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:

- name: Check for repository changes and commit
id: check_changes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
Expand Down Expand Up @@ -93,18 +91,26 @@ jobs:
echo "TZDATA_VERSION=$TZDATA_VERSION" >> $GITHUB_ENV
echo "TZDATA_NEWS=$TZDATA_NEWS" >> $GITHUB_ENV
- name: Check for repository changes and commit
id: commit_changes
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
git commit -m "Update tzdata to version $TZDATA_VERSION"
echo "::set-output name=changes_detected::true"
- name: Create PR
id: commit_changes
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
git commit -m "Update tzdata to version $TZDATA_VERSION" \
-m "$TZDATA_NEWS"
echo "::set-output name=changes_detected::true"
create-pr:
runs-on: ubuntu-latest
needs: check-for-updates
if: needs.check-for-updates.outputs.changes_detected == 'true' # Run only if changes are detected
steps:
- name: Create pull request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
gh pr create --title "Update tzdata to version $TZDATA_VERSION" \
--body "$TZDATA_NEWS" \
Expand Down

0 comments on commit 14d7cc2

Please sign in to comment.