-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (73 loc) · 2.56 KB
/
generate-samples.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: Generate PNG Samples
# yamllint disable rule:truthy
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
generate-samples:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.4.2
- name: Checkout
uses: actions/checkout@v4
with:
# specify the tag as the ref to checkout
ref: ${{ github.ref }}
- name: Configure Environment
run: |
# add the tag name to the environment
echo "BOTC_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Get JSON
shell: bash
run: |
make grab-some-scripts
ls -larth scripts
- name: Generate samples
shell: bash
env:
BOTC_PDF2IMAGE: yes-please
run: |
sudo apt-get install -y poppler-utils
make all-scripts
ls -larth generated/*
# and eventually we'll create a PR for this
# but we need to make sure we don't end up in a loop
# of generate -> new version -> generate -> new version ...
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
# yamllint disable-line rule:line-length
title: Generate PNG sample images for ${{env.BOTC_TAG || 'unknown'}} [auto-generated]
# add some labels
labels: automatic-pr, generate-pngs
# this is the name of the branch created to hold the changes for the
# PR
branch: generate-pngs/${{ github.sha }}
# just to be extra safe we specify that we want to merge into the
# default branch
base: ${{ github.event.repository.default_branch }}
# no need to keep the branch around after the PR is merged
delete-branch: true
# ignore any (accidental?) changes outside of the user_access/ dir
add-paths: |
generated/
# yamllint disable-line rule:line-length
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ secrets.CHISEL_GITHUB_TOKEN }}
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
# yamllint disable rule:line-length
run: |
echo "::notice::Pull Request Created - ${{ steps.cpr.outputs.pull-request-url }}"
# yamllint enable rule:line-length