Skip to content

Commit 30d4102

Browse files
authored
maintenance on the readme (#70)
* correct the ways assignees have to be formatted * make the note more visible * note about the file not necessarily having to exist * change the markup to important * split the steps by the permissions needed * reflow * reword * reword the tip about permissions
1 parent a9e6b3d commit 30d4102

1 file changed

Lines changed: 37 additions & 10 deletions

File tree

README.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ How this works:
1414

1515
To use the `issue-from-pytest-log` action in workflows, simply add a new step:
1616

17-
> [!WARNING]
18-
> The action won't run properly unless the `issues: write` permission is requested as shown below.
17+
> [!IMPORTANT]
18+
> The action won't run properly unless the `issues: write` permission is requested as
19+
> shown below.
1920
2021
```yaml
22+
permissions: {}
23+
2124
jobs:
2225
my-job:
2326
...
2427
strategy:
2528
fail-fast: false
2629
...
2730

28-
permissions:
29-
issues: write
30-
3131
...
3232

3333
- uses: actions/setup-python@v4
@@ -45,16 +45,37 @@ jobs:
4545
- run: |
4646
pytest --report-log pytest-log.jsonl
4747
48-
...
48+
- uses: actions/upload-artifact@...
49+
with:
50+
name: log file
51+
path: pytest-log-jsonl
52+
53+
create-issue:
54+
needs: my-job
55+
runs-on: ubuntu-latest
56+
57+
permissions:
58+
issues: write
59+
60+
steps:
61+
- uses: actions/download-artifact@...
62+
with:
63+
name: log file
64+
path: logs/
4965

5066
- uses: scientific-python/issue-from-pytest-log-action@f94477e45ef40e4403d7585ba639a9a3bcc53d43 # v1.3.0
5167
if: |
5268
failure()
5369
&& ...
5470
with:
55-
log-path: pytest-log.jsonl
71+
log-path: logs/pytest-log.jsonl
5672
```
5773
74+
> [!TIP]
75+
> In the example above, the action is in a separate job from the test run to avoid giving
76+
> untrusted code (typically nightly dependencies) access to a token that can modify the
77+
> repository. This is good practice to reduce the risk of supply-chain attacks.
78+
5879
See [this repository](https://github.com/keewis/reportlog-test/issues) for example issues. For more realistic examples, see
5980
6081
- `xarray` ([workflow](https://github.com/pydata/xarray/blob/main/.github/workflows/upstream-dev-ci.yaml), [example issue](https://github.com/pydata/xarray/issues/6197))
@@ -68,6 +89,11 @@ required.
6889

6990
Use `log-path` to specify where the output of `pytest-reportlog` is.
7091

92+
> [!NOTE]
93+
> If the log file is missing (for example, because the workflow failed before `pytest` was
94+
> run), the action will still open / update, but the issue won't contain details about the
95+
> exact failure.
96+
7197
### issue title
7298

7399
optional. Default: `⚠️ Nightly upstream-dev CI failed ⚠️`
@@ -98,15 +124,16 @@ The label to set on the new issue.
98124

99125
### assignees
100126

101-
optional
127+
optional. A comma-separated list of users.
102128

103129
Any assignees to set on the new issue:
104130

105131
```yaml
106132
- uses: scientific-python/issue-from-pytest-log-action@f94477e45ef40e4403d7585ba639a9a3bcc53d43 # v1.3.0
107133
with:
108134
log-path: pytest-log.jsonl
109-
assignees: ["user1", "user2"]
135+
assignees: user1,user2
110136
```
111137

112-
Note that assignees must have the commit bit on the repository.
138+
> [!IMPORTANT]
139+
> Note that assignees must have the commit bit on the repository.

0 commit comments

Comments
 (0)