Bump actions/setup-python from 5.1.1 to 5.2.0 in /.github/workflows #32
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: create-logo | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "docs/logo.json" | |
- .github/workflows/create-logo.yml | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
actions: write | |
jobs: | |
init: | |
name: init | |
runs-on: ubuntu-latest | |
outputs: | |
action: ${{ steps.init.outputs.action }} | |
steps: | |
- id: init | |
name: "init" | |
shell: bash | |
run: | | |
if [[ -n "${{ secrets.OPENAI_API_KEY }}" ]] | |
then | |
echo 'action=true' >> "${GITHUB_OUTPUT}" | |
else | |
echo 'action=false' >> "${GITHUB_OUTPUT}" | |
fi | |
create-logos: | |
needs: [init] | |
if: needs.init.outputs.action == 'true' && github.head_ref != 'release-please--branches--main' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
file: [docs/logo.json] | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- name: create svg ${{ matrix.file }} | |
run: | | |
# checkov:skip=CKV_GHA_3: "Suspicious use of curl with secrets" | |
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.OPENAI_API_KEY }}" -d @${{ matrix.file }} https://api.openai.com/v1/chat/completions | jq -r '.choices[0].message.content' > docs/`basename -s .json ${{ matrix.file }}`.svg | |
- name: "install deps" | |
run: | | |
sudo apt install -y libfreetype6-dev gsfonts libmagickwand-dev imagemagick | |
- name: Install Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 | |
with: | |
python-version: 3.x | |
- name: Build Docs | |
env: | |
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
mkdocs build | |
- name: Push changes | |
env: | |
BRANCH: ${{github.event.pull_request.head.ref}} | |
run: | | |
git config user.name "$(git log -n 1 --pretty=format:%an)" | |
git config user.email "$(git log -n 1 --pretty=format:%ae)" | |
git add . | |
git commit -m "docs(${{ matrix.file }}): creating" | |
git config pull.rebase false | |
git pull | |
git push --force-with-lease |