Skip to content

Commit

Permalink
GHA: merge create PR step
Browse files Browse the repository at this point in the history
No need to create an extra step. Let's keep the PR creation part of
the script step and conditionally create a PR if it's really necessary.
  • Loading branch information
picnoir committed Mar 28, 2024
1 parent 8508f04 commit 8ed95ba
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/update-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ jobs:
echo "Images up to date"
exit 0
else
echo "New image"
git diff
git config user.name github-actions
git config user.email [email protected]
git checkout -b update-images-$(date +%F)
branchname="update-images-$(date +%F)"
git checkout -b "${branchname}"
git add debian/images.json
git commit -m "Update images: $(date +%F)"
git push
git push origin "${branchname}"
gh pr create -B main -H "${branchname}" \
--title 'Bump images.json' \
--body 'PR generated using scripts/update-images.py'
fi
- name: create pull request
run: |
gh pr create -B main -H update-images-$(date +%F) \
--title 'Bump images.json' \
--body 'PR generated using scripts/update-images.py'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8ed95ba

Please sign in to comment.