Merge pull request #283 from chizmw/changeset-release/main #79
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |