-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Include workflow name in cache key * Update pyproject.toml * Refactor StubLoader into SpyEnvironment, SpyContext, and SpyFileSystemLoader * Distinguish between required and optional context * Default details to open when errors occur * Fix get_source auditing * Rename Spy to Audit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename spy contextmanager to audit * Initialize test suite * Add test_dump_summary * Parametrize TemplateState tests * Add initial test for template_file * Initialize test suite * Install all dependencies * Upload coverage * Add badges * Update README.md * Update test_template_files.py * Stringify * Standardize Python * Enable dependabot updates for pip * Add analyze step with automated error reports * Minor cleanup * Update existing failures * Catch IsADirectoryError * Typing * Pytest ids * Update README * Add GHA test * Fix stub audit * Comment template-files summary * Update tests * Use a sticky comment instead * Formatting * Use fine-grained token * Improve messaging --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jannis Leidel <[email protected]>
- Loading branch information
1 parent
c01236b
commit 7873f9d
Showing
33 changed files
with
1,068 additions
and
145 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
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
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,4 @@ | ||
org/repo: | ||
- remove: true | ||
- with: | ||
variable: value |
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 @@ | ||
org/repo: | ||
- dst: file.txt | ||
- remove: true | ||
- with: | ||
variable: value |
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,2 @@ | ||
org/repo: | ||
- dst: true |
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,2 @@ | ||
org/repo: | ||
- dst: 1 |
Empty file.
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,2 @@ | ||
org/repo: | ||
- remove: 1 |
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,2 @@ | ||
org/repo: | ||
- remove: string |
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,2 @@ | ||
org/repo: | ||
- src: true |
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,2 @@ | ||
org/repo: | ||
- src: 1 |
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,2 @@ | ||
org/repo: | ||
- with: string |
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,23 @@ | ||
org/repo: | ||
# paths are copied from org/repo to current repo | ||
- file.txt | ||
- path/to/file.txt | ||
|
||
org/repo2: | ||
# paths are copied from org/repo2 to current repo | ||
- src: file2.txt | ||
dst: path/to/file2.txt | ||
# paths are copied from org/repo2 to current repo with templating | ||
- src: file3.txt | ||
with: | ||
variable: value | ||
- src: file4.txt | ||
dst: path/to/file4.txt | ||
with: | ||
variable: value | ||
# remove dst paths from current repo | ||
- dst: file5.txt | ||
remove: true | ||
# remove src paths from current repo | ||
- src: file6.txt | ||
remove: true |
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,3 @@ | ||
org/repo: | ||
- file.txt | ||
- path/to/file.txt |
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 @@ | ||
./templates: | ||
- src: file1.txt | ||
dst: .github_cache/template-files/error/file1.txt | ||
- src: file2.txt | ||
dst: .github_cache/template-files/error/file2.txt |
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,21 @@ | ||
# file1 | ||
|
||
This is a template and only uses the default context. | ||
|
||
| context | value | | ||
|---|---| | ||
| repo.html_url | https://github.com/conda/actions | | ||
| repo.full_name | conda/actions | | ||
| source.user | <local> | | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet justo ipsum, nec dapibus ex congue ac. Fusce non vulputate libero. Nulla fermentum nisl finibus turpis tempor, non porttitor massa rutrum. Sed suscipit metus arcu, eu blandit ante condimentum in. Proin vehicula various risus eget fermentum. Duis in sollicitudin ante. Curabitur aliquam elit vel dictum sagittis. Proin nec ultrices sem, ac sodales leo. Duis vehicula, metus nec tristique vestibulum, massa mi faucibus urna, quis pulvinar neque neque congue felis. Nulla lobortis ullamcorper imperdiet. Fusce justo arcu, tristique nec tincidunt commodo, porttitor sit amet neque. Nullam tincidunt orci a enim fringilla sodales. Morbi ut dui vitae justo interdum ullamcorper. | ||
|
||
# stub1 | ||
|
||
Nullam blandit nisi non elit efficitur porttitor quis a justo. Sed venenatis, eros quis malesuada aliquet, ligula purus cursus velit, eget efficitur libero ante id ipsum. Aliquam et neque id justo tempus egestas quis ut augue. Curabitur eu sem velit. Phasellus sed nunc ipsum. Sed rhoncus luctus turpis, eu rutrum ipsum dictum nec. Curabitur vulputate dolor non ipsum ultrices, ut ultricies nibh vestibulum. Donec molestie scelerisque interdum. Vestibulum et finibus purus, rhoncus porttitor ligula. | ||
|
||
# stub2 | ||
|
||
Curabitur metus libero, lacinia nec magna euismod, pellentesque lacinia sem. Nullam tempor vitae ex ut tincidunt. Etiam ullamcorper et nisi at cursus. Praesent ac mauris vel mauris ornare consequat sit amet ut magna. Integer luctus, ante at rhoncus cursus, est erat aliquam magna, et pretium urna felis eget lorem. Etiam tristique, justo viverra cursus congue, quam odio sagittis dolor, quis dictum risus tortor et turpis. Donec arcu urna, dapibus eget metus ac, consequat feugiat velit. Integer aliquet velit quis sollicitudin luctus. Maecenas aliquam arcu non urna maximus hendrerit. Integer porta efficitur blandit. Donec interdum nec metus at iaculis. Donec pellentesque enim turpis. Nulla facilisi. In hac habitasse platea dictumst. | ||
|
||
EOF |
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,16 @@ | ||
# file2 | ||
|
||
This is a template and expects additional context. | ||
|
||
| context | value | | ||
|---|---| | ||
| variable | | | ||
| optional | 12 | | ||
|
||
Name finibus augue ac efficitur sodales. Donec facilisis lacus sit amet metus congue aliquam. Proin mollis, sapien sit amet iaculis congue, libero erat volutpat neque, in bibendum lacus massa eget eros. Mauris fringilla turpis id pulvinar ultricies. Cras dictum condimentum mauris sit amet lobortis. Maecenas ultrices in lectus eget tristique. Etiam sollicitudin tempus dolor sit amet tincidunt. Nulla nec mi eget est gravida elementum vitae vitae risus. Nullam eget urna dignissim, sollicitudin massa at, cursus urna. | ||
|
||
# stub2 | ||
|
||
Curabitur metus libero, lacinia nec magna euismod, pellentesque lacinia sem. Nullam tempor vitae ex ut tincidunt. Etiam ullamcorper et nisi at cursus. Praesent ac mauris vel mauris ornare consequat sit amet ut magna. Integer luctus, ante at rhoncus cursus, est erat aliquam magna, et pretium urna felis eget lorem. Etiam tristique, justo viverra cursus congue, quam odio sagittis dolor, quis dictum risus tortor et turpis. Donec arcu urna, dapibus eget metus ac, consequat feugiat velit. Integer aliquet velit quis sollicitudin luctus. Maecenas aliquam arcu non urna maximus hendrerit. Integer porta efficitur blandit. Donec interdum nec metus at iaculis. Donec pellentesque enim turpis. Nulla facilisi. In hac habitasse platea dictumst. | ||
|
||
EOF |
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,21 @@ | ||
# file1 | ||
|
||
This is a template and only uses the default context. | ||
|
||
| context | value | | ||
|---|---| | ||
| repo.html_url | https://github.com/conda/actions | | ||
| repo.full_name | conda/actions | | ||
| source.user | <local> | | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet justo ipsum, nec dapibus ex congue ac. Fusce non vulputate libero. Nulla fermentum nisl finibus turpis tempor, non porttitor massa rutrum. Sed suscipit metus arcu, eu blandit ante condimentum in. Proin vehicula various risus eget fermentum. Duis in sollicitudin ante. Curabitur aliquam elit vel dictum sagittis. Proin nec ultrices sem, ac sodales leo. Duis vehicula, metus nec tristique vestibulum, massa mi faucibus urna, quis pulvinar neque neque congue felis. Nulla lobortis ullamcorper imperdiet. Fusce justo arcu, tristique nec tincidunt commodo, porttitor sit amet neque. Nullam tincidunt orci a enim fringilla sodales. Morbi ut dui vitae justo interdum ullamcorper. | ||
|
||
# stub1 | ||
|
||
Nullam blandit nisi non elit efficitur porttitor quis a justo. Sed venenatis, eros quis malesuada aliquet, ligula purus cursus velit, eget efficitur libero ante id ipsum. Aliquam et neque id justo tempus egestas quis ut augue. Curabitur eu sem velit. Phasellus sed nunc ipsum. Sed rhoncus luctus turpis, eu rutrum ipsum dictum nec. Curabitur vulputate dolor non ipsum ultrices, ut ultricies nibh vestibulum. Donec molestie scelerisque interdum. Vestibulum et finibus purus, rhoncus porttitor ligula. | ||
|
||
# stub2 | ||
|
||
Curabitur metus libero, lacinia nec magna euismod, pellentesque lacinia sem. Nullam tempor vitae ex ut tincidunt. Etiam ullamcorper et nisi at cursus. Praesent ac mauris vel mauris ornare consequat sit amet ut magna. Integer luctus, ante at rhoncus cursus, est erat aliquam magna, et pretium urna felis eget lorem. Etiam tristique, justo viverra cursus congue, quam odio sagittis dolor, quis dictum risus tortor et turpis. Donec arcu urna, dapibus eget metus ac, consequat feugiat velit. Integer aliquet velit quis sollicitudin luctus. Maecenas aliquam arcu non urna maximus hendrerit. Integer porta efficitur blandit. Donec interdum nec metus at iaculis. Donec pellentesque enim turpis. Nulla facilisi. In hac habitasse platea dictumst. | ||
|
||
EOF |
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,16 @@ | ||
# file2 | ||
|
||
This is a template and expects additional context. | ||
|
||
| context | value | | ||
|---|---| | ||
| variable | value | | ||
| optional | 12 | | ||
|
||
Name finibus augue ac efficitur sodales. Donec facilisis lacus sit amet metus congue aliquam. Proin mollis, sapien sit amet iaculis congue, libero erat volutpat neque, in bibendum lacus massa eget eros. Mauris fringilla turpis id pulvinar ultricies. Cras dictum condimentum mauris sit amet lobortis. Maecenas ultrices in lectus eget tristique. Etiam sollicitudin tempus dolor sit amet tincidunt. Nulla nec mi eget est gravida elementum vitae vitae risus. Nullam eget urna dignissim, sollicitudin massa at, cursus urna. | ||
|
||
# stub2 | ||
|
||
Curabitur metus libero, lacinia nec magna euismod, pellentesque lacinia sem. Nullam tempor vitae ex ut tincidunt. Etiam ullamcorper et nisi at cursus. Praesent ac mauris vel mauris ornare consequat sit amet ut magna. Integer luctus, ante at rhoncus cursus, est erat aliquam magna, et pretium urna felis eget lorem. Etiam tristique, justo viverra cursus congue, quam odio sagittis dolor, quis dictum risus tortor et turpis. Donec arcu urna, dapibus eget metus ac, consequat feugiat velit. Integer aliquet velit quis sollicitudin luctus. Maecenas aliquam arcu non urna maximus hendrerit. Integer porta efficitur blandit. Donec interdum nec metus at iaculis. Donec pellentesque enim turpis. Nulla facilisi. In hac habitasse platea dictumst. | ||
|
||
EOF |
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,7 @@ | ||
./templates: | ||
- src: file1.txt | ||
dst: .github_cache/template-files/success/file1.txt | ||
- src: file2.txt | ||
dst: .github_cache/template-files/success/file2.txt | ||
with: | ||
variable: value |
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,15 @@ | ||
# file1 | ||
|
||
This is a template and only uses the default context. | ||
|
||
| context | value | | ||
|---|---| | ||
| repo.html_url | [[ repo.html_url ]] | | ||
| repo.full_name | [[ repo.full_name ]] | | ||
| source.user | [[ source.user ]] | | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet justo ipsum, nec dapibus ex congue ac. Fusce non vulputate libero. Nulla fermentum nisl finibus turpis tempor, non porttitor massa rutrum. Sed suscipit metus arcu, eu blandit ante condimentum in. Proin vehicula various risus eget fermentum. Duis in sollicitudin ante. Curabitur aliquam elit vel dictum sagittis. Proin nec ultrices sem, ac sodales leo. Duis vehicula, metus nec tristique vestibulum, massa mi faucibus urna, quis pulvinar neque neque congue felis. Nulla lobortis ullamcorper imperdiet. Fusce justo arcu, tristique nec tincidunt commodo, porttitor sit amet neque. Nullam tincidunt orci a enim fringilla sodales. Morbi ut dui vitae justo interdum ullamcorper. | ||
|
||
[% include 'stub1.txt' ignore missing -%] | ||
|
||
EOF |
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,14 @@ | ||
# file2 | ||
|
||
This is a template and expects additional context. | ||
|
||
| context | value | | ||
|---|---| | ||
| variable | [[ variable ]] | | ||
| optional | [[ optional or 12 ]] | | ||
|
||
Name finibus augue ac efficitur sodales. Donec facilisis lacus sit amet metus congue aliquam. Proin mollis, sapien sit amet iaculis congue, libero erat volutpat neque, in bibendum lacus massa eget eros. Mauris fringilla turpis id pulvinar ultricies. Cras dictum condimentum mauris sit amet lobortis. Maecenas ultrices in lectus eget tristique. Etiam sollicitudin tempus dolor sit amet tincidunt. Nulla nec mi eget est gravida elementum vitae vitae risus. Nullam eget urna dignissim, sollicitudin massa at, cursus urna. | ||
|
||
[% include 'stub2.txt' ignore missing -%] | ||
|
||
EOF |
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 @@ | ||
# stub1 | ||
|
||
Nullam blandit nisi non elit efficitur porttitor quis a justo. Sed venenatis, eros quis malesuada aliquet, ligula purus cursus velit, eget efficitur libero ante id ipsum. Aliquam et neque id justo tempus egestas quis ut augue. Curabitur eu sem velit. Phasellus sed nunc ipsum. Sed rhoncus luctus turpis, eu rutrum ipsum dictum nec. Curabitur vulputate dolor non ipsum ultrices, ut ultricies nibh vestibulum. Donec molestie scelerisque interdum. Vestibulum et finibus purus, rhoncus porttitor ligula. | ||
|
||
[% include 'stub2.txt' ignore missing -%] |
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 @@ | ||
# stub2 | ||
|
||
Curabitur metus libero, lacinia nec magna euismod, pellentesque lacinia sem. Nullam tempor vitae ex ut tincidunt. Etiam ullamcorper et nisi at cursus. Praesent ac mauris vel mauris ornare consequat sit amet ut magna. Integer luctus, ante at rhoncus cursus, est erat aliquam magna, et pretium urna felis eget lorem. Etiam tristique, justo viverra cursus congue, quam odio sagittis dolor, quis dictum risus tortor et turpis. Donec arcu urna, dapibus eget metus ac, consequat feugiat velit. Integer aliquet velit quis sollicitudin luctus. Maecenas aliquam arcu non urna maximus hendrerit. Integer porta efficitur blandit. Donec interdum nec metus at iaculis. Donec pellentesque enim turpis. Nulla facilisi. In hac habitasse platea dictumst. | ||
|
||
[% include 'stub3.txt' ignore missing -%] |
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 @@ | ||
{{ 1/0 }} |
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 @@ | ||
This is a stub. |
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,6 @@ | ||
Sample Template | ||
|
||
Destination repository: {{ dst.full_name }} | ||
Source repository: {{ src.full_name }} | ||
|
||
This will cause error if context is undefined: {{ variable }} |
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 @@ | ||
{% include 'missing.stub' %} |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ jsonschema | |
pygithub | ||
pyyaml | ||
rich | ||
wrapt |
Oops, something went wrong.