Skip to content

Update Examples Cron #4065

Update Examples Cron

Update Examples Cron #4065

name: Update Examples Cron
on:
schedule:
- cron: '0 */8 * * *'
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
update-examples-cron:
if: github.repository == 'grafana/pyroscope'
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-small' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: 'false'
- id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@bae259f9ed5b6fcb050e3b58adf7aee776d4edb5
with:
repo_secrets: |
GITHUB_APP_ID=pyroscope-development-app:app-id
GITHUB_APP_INSTALLATION_ID=pyroscope-development-app:app-installation-id
GITHUB_APP_PRIVATE_KEY=pyroscope-development-app:private-key
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ env.GITHUB_APP_ID }}
private-key: ${{ env.GITHUB_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
pyroscope
- run: |
make tools/update_examples
if ! git diff --exit-code;
then
make tools/update_examples_pr
fi
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
GITHUB_REPOSITORY: ${{ github.repository }}