Skip to content

Commit 7fd20d2

Browse files
committed
Add cookiecutter workflow
1 parent daa51ca commit 7fd20d2

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

.github/workflows/cookiecutter.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: "Update CI from cookiecutter"
3+
on:
4+
workflow_dispatch:
5+
6+
defaults:
7+
run:
8+
working-directory: "pulp-cli"
9+
10+
jobs:
11+
update-ci:
12+
runs-on: "ubuntu-latest"
13+
steps:
14+
- uses: "actions/checkout@v4"
15+
with:
16+
repository: "pulp/pulp-cli"
17+
path: "pulp-cli"
18+
- uses: "actions/checkout@v4"
19+
with:
20+
token: "${{ secrets.RELEASE_TOKEN }}"
21+
path: "pulp-cli"
22+
- name: "Set up Python"
23+
uses: "actions/setup-python@v5"
24+
with:
25+
python-version: "3.11"
26+
- name: "Setup git"
27+
run: |
28+
git config user.name pulpbot
29+
git config user.email [email protected]
30+
- name: "Install python dependencies"
31+
run: |
32+
pip install cookiecutter tomlkit
33+
- name: "Apply cookiecutter templates"
34+
run: |
35+
../pulp-cli/cookiecutter/apply_templates.py
36+
- name: "Create Pull Request"
37+
uses: "peter-evans/create-pull-request@v7"
38+
id: "create_pr"
39+
with:
40+
token: "${{ secrets.RELEASE_TOKEN }}"
41+
title: "Update cookiecutter"
42+
body: ""
43+
branch: "update_cookiecutter"
44+
delete-branch: true
45+
path: "pulp-cli"
46+
- name: "Mark PR automerge"
47+
run: |
48+
gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}"
49+
if: "steps.create_pr.outputs.pull-request-number"
50+
env:
51+
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
52+
continue-on-error: true
53+
...
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: "Update CI from cookiecutter"
3+
on:
4+
workflow_dispatch:
5+
6+
defaults:
7+
run:
8+
working-directory: "pulp-cli{{ cookiecutter.__app_label_suffix }}"
9+
10+
jobs:
11+
update-ci:
12+
runs-on: "ubuntu-latest"
13+
steps:
14+
- uses: "actions/checkout@v4"
15+
with:
16+
repository: "pulp/pulp-cli"
17+
path: "pulp-cli"
18+
- uses: "actions/checkout@v4"
19+
with:
20+
{%- raw %}
21+
token: "${{ secrets.RELEASE_TOKEN }}"
22+
{%- endraw %}
23+
path: "pulp-cli{{ cookiecutter.__app_label_suffix }}"
24+
- name: "Set up Python"
25+
uses: "actions/setup-python@v5"
26+
with:
27+
python-version: "3.11"
28+
- name: "Setup git"
29+
run: |
30+
git config user.name pulpbot
31+
git config user.email [email protected]
32+
- name: "Install python dependencies"
33+
run: |
34+
pip install cookiecutter tomlkit
35+
- name: "Apply cookiecutter templates"
36+
run: |
37+
../pulp-cli/cookiecutter/apply_templates.py
38+
- name: "Create Pull Request"
39+
uses: "peter-evans/create-pull-request@v7"
40+
id: "create_pr"
41+
with:
42+
{%- raw %}
43+
token: "${{ secrets.RELEASE_TOKEN }}"
44+
{%- endraw %}
45+
title: "Update cookiecutter"
46+
body: ""
47+
branch: "update_cookiecutter"
48+
delete-branch: true
49+
path: "pulp-cli{{ cookiecutter.__app_label_suffix }}"
50+
{%- raw %}
51+
- name: "Mark PR automerge"
52+
run: |
53+
gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}"
54+
if: "steps.create_pr.outputs.pull-request-number"
55+
env:
56+
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
57+
continue-on-error: true
58+
{%- endraw %}
59+
...

0 commit comments

Comments
 (0)