Skip to content

Commit

Permalink
Install GH cli to make PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ATechAdventurer committed Sep 10, 2023
1 parent ff8246a commit f020d28
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,31 @@ jobs:
awk -v new_image="$NEW_IMAGE" 'BEGIN {OFS=FS} /^image =/ {$0=new_image} {print}' gitops/containers/gliderbot/gliderbot.toml > gitops/containers/gliderbot/gliderbot.toml.tmp
mv gitops/containers/gliderbot/gliderbot.toml.tmp gitops/containers/gliderbot/gliderbot.toml
# Commit and create a pull request
- name: Commit changes and create a pull request
# Install GitHub CLI
- name: Install GitHub CLI
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
# Configure GitHub CLI
- name: Configure GitHub CLI
run: gh auth login --with-token ${{ secrets.ACCESS_TOKEN }}

# Create a new branch and commit changes
- name: Create a new branch and commit changes
run: |
cd gitops
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git checkout -b update-gliderbot-image
git add containers/gliderbot/gliderbot.toml
git add -A
git commit -m "Update Gliderbot image"
git push origin update-gliderbot-image
gh pr create --base main --head update-gliderbot-image --title "Update Gliderbot image" --body "Automated update of Gliderbot image."
# Create Pull Request
- name: Create Pull Request
run: |
cd gitops
gh pr create --base main --head update-gliderbot-image --title "Update Gliderbot image" --body "Automated PR to update the Gliderbot image."

0 comments on commit f020d28

Please sign in to comment.