Skip to content

sync-from-sunbeam

sync-from-sunbeam #19

# This workflow is to sync dashboards and alert rules from the Sunbeam repo and create a PR if there is an update.
name: sync-from-sunbeam
on:
workflow_dispatch:
workflow_call:
schedule:
- cron: '43 1 * * 1'
env:
REPO_OWNER: canonical
REPO_PATH: openstack-exporter-operator
jobs:
sync-from-sunbeam:
name: Pull files from sunbeam
runs-on: ubuntu-latest
steps:
- name: Checkout local repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Pull dashboard and alert rules from sunbeam
run: |
./scripts/sync-from-sunbeam.sh
- uses: actions/create-github-app-token@v1
id: app_token
with:
app-id: ${{ secrets.APP_ID }}
owner: ${{ env.REPO_OWNER }}
private-key: ${{ secrets.APP_PEM }}
repositories: ${{ env.REPO_PATH }}
- name: Create pull request
uses: canonical/create-pull-request@main
with:
upsert: true # Allow update PRs
ignore-no-changes: true # Enabling this option allows the action to do nothing and exit successfully when there are no changes.
branch-name: chore/sync-from-sunbeam # create new branch with the changes as the source branch for the PR
github-token: ${{ steps.app_token.outputs.token }}
repository: ${{ env.REPO_OWNER }}/${{ env.REPO_PATH }}
title: "Update dashboards and alerts"
body: |
Automated action to fetch the latest grafana dashboards and alert rules from Sunbeam https://opendev.org/openstack/sunbeam-charms/src/branch/main/charms/openstack-exporter-k8s/src.
The branch of this PR will be overwritten 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.
commit-message: |
Update dashboards and alerts from Sunbeam https://opendev.org/openstack/sunbeam-charms/src/branch/main/charms/openstack-exporter-k8s/src
This commit was generated by https://github.com/canonical/openstack-exporter-operator/blob/main/.github/workflows/sync-from-sunbeam.yaml