Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds update-libs workflow #45

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/update-libs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Auto-update Charm Libraries
on:
workflow_dispatch:
schedule:
- cron: "0 0,12 * * *"

permissions:
contents: write
pull-requests: write

jobs:
update-lib:
name: Check libraries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up SSH Key for Signing Commits
run: |
mkdir -p ~/.ssh
echo "${{ secrets.BOT_PRIVATE_SIGNING_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "${{ secrets.BOT_PUBLIC_SIGNING_KEY }}" > ~/.ssh/id_rsa.pub
chmod 644 ~/.ssh/id_rsa.pub
git config --global user.email "[email protected]"
git config --global user.name "telcobot"
git config --global user.signingkey ~/.ssh/id_rsa.pub
git config --global commit.gpgsign true
git config --global gpg.format ssh

- name: Fetch charm libraries
run: |
sudo snap install charmcraft --classic --channel latest/stable
charmcraft fetch-lib
env:
CHARMCRAFT_AUTH: "${{ secrets.CHARMCRAFT_AUTH }}"

- name: Create a PR for local changes
uses: peter-evans/[email protected]
with:
token: ${{ secrets.TELCO_GITHUB_BOT_TOKEN }}
commit-message: "chore: update charm libraries"
committer: "Telcobot <[email protected]>"
author: "Telcobot <[email protected]>"
title: "chore: Update charm libraries"
body: |
Automated action to fetch latest version of charm libraries. The branch of this PR
will be wiped during the next check. Unless you really know what you're doing, you
most likely don't want to push any commits to this branch.
branch: "chore/auto-libs"
delete-branch: true
Loading