-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Philip Meier <github.pmeier@posteo.de>
- Loading branch information
Showing
9 changed files
with
68 additions
and
115 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: publish-from-template | ||
description: "Publish information from a template" | ||
|
||
inputs: | ||
filename: | ||
description: Path to issue template. Usually in .github/issue-templates | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Render template | ||
# Render template only in CI to make sure rendering on a schedule works as planned | ||
if: github.event_name != 'schedule' | ||
shell: bash | ||
env: ${{ env }} | ||
run: | ||
python .github/actions/publish-from-template/render_template.py ${{ | ||
inputs.filename }} | ||
|
||
- uses: JasonEtco/create-an-issue@v2 | ||
# Only render template and create an issue in case the workflow is a scheduled one | ||
if: github.event_name == 'schedule' | ||
env: ${{ env }} | ||
with: | ||
filename: ${{ inputs.filename }} | ||
update_existing: false |
17 changes: 17 additions & 0 deletions
17
.github/actions/publish-from-template/publish-from-template.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import pathlib | ||
import sys | ||
|
||
import jinja2 | ||
|
||
|
||
def main(template_path): | ||
loader = jinja2.FileSystemLoader(searchpath=template_path.parent) | ||
env = jinja2.Environment(loader=loader) | ||
template = env.get_template(template_path.name) | ||
print(template.render(env=os.environ)) | ||
|
||
|
||
if __name__ == "__main__": | ||
template_path = pathlib.Path(sys.argv[1]) | ||
main(template_path) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Provider CI jobs fail for {{ env.PROVIDER }} / {{ env.CICD }} | ||
--- | ||
|
||
See /~https://github.com/{{ env.REPO }}/actions/runs/{{ env.ID }} for details. |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ dev = [ | |
"pytest-timeout", | ||
"grayskull", | ||
"build", | ||
"jinja2", | ||
] | ||
|
||
[project.urls] | ||
|