Skip to content

Commit

Permalink
Add cookiecutter workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Feb 26, 2025
1 parent daa51ca commit 7fd20d2
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: "Update CI from cookiecutter"
on:
workflow_dispatch:

defaults:
run:
working-directory: "pulp-cli"

jobs:
update-ci:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp-cli"
path: "pulp-cli"
- uses: "actions/checkout@v4"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-cli"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.11"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email [email protected]
- name: "Install python dependencies"
run: |
pip install cookiecutter tomlkit
- name: "Apply cookiecutter templates"
run: |
../pulp-cli/cookiecutter/apply_templates.py
- name: "Create Pull Request"
uses: "peter-evans/create-pull-request@v7"
id: "create_pr"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
title: "Update cookiecutter"
body: ""
branch: "update_cookiecutter"
delete-branch: true
path: "pulp-cli"
- name: "Mark PR automerge"
run: |
gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}"
if: "steps.create_pr.outputs.pull-request-number"
env:
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
continue-on-error: true
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: "Update CI from cookiecutter"
on:
workflow_dispatch:

defaults:
run:
working-directory: "pulp-cli{{ cookiecutter.__app_label_suffix }}"

jobs:
update-ci:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with:
repository: "pulp/pulp-cli"
path: "pulp-cli"
- uses: "actions/checkout@v4"
with:
{%- raw %}
token: "${{ secrets.RELEASE_TOKEN }}"
{%- endraw %}
path: "pulp-cli{{ cookiecutter.__app_label_suffix }}"
- name: "Set up Python"
uses: "actions/setup-python@v5"
with:
python-version: "3.11"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email [email protected]
- name: "Install python dependencies"
run: |
pip install cookiecutter tomlkit
- name: "Apply cookiecutter templates"
run: |
../pulp-cli/cookiecutter/apply_templates.py
- name: "Create Pull Request"
uses: "peter-evans/create-pull-request@v7"
id: "create_pr"
with:
{%- raw %}
token: "${{ secrets.RELEASE_TOKEN }}"
{%- endraw %}
title: "Update cookiecutter"
body: ""
branch: "update_cookiecutter"
delete-branch: true
path: "pulp-cli{{ cookiecutter.__app_label_suffix }}"
{%- raw %}
- name: "Mark PR automerge"
run: |
gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}"
if: "steps.create_pr.outputs.pull-request-number"
env:
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
continue-on-error: true
{%- endraw %}
...

0 comments on commit 7fd20d2

Please sign in to comment.