-
Notifications
You must be signed in to change notification settings - Fork 55
57 lines (48 loc) · 2.01 KB
/
automatic-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update Grafana Version
on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:
jobs:
update-grafana:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PEM }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Update Grafana version
run: |
bash scripts/update-grafana-version.sh
- name: Check the status of the repo
id: status
run: |
echo "status=$(git diff-index --quiet --exit-code HEAD && echo '0' || echo '1')" >> $GITHUB_OUTPUT
- name: Create PR
id: create_pr
if: ${{ steps.status.outputs.status == '1' }}
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate_token.outputs.token }}
branch: new-update-plugin-examples
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
delete-branch: true
commit-message: "chore: update configuration to latest version"
title: "Chore: Bump plugin-examples configuration to latest version"
body: |
Bumps [`grafana-plugin-examples`](https://github.com/grafana/grafana-plugin-examples) configuration to the latest version.
**Notes for reviewer:**
This is an auto-generated PR which ran `npx -y @grafana/create-plugin@latest update`, updates plugin.json files, grafana-plugin-sdk-go and docker-compose files for each plugin example
- name: Enable auto-merge for PR
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ steps.create_pr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Auto approve PR
run: gh pr review ${{ steps.create_pr.outputs.pull-request-url }} --approve -b "Approving update"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}