You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-3
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,31 @@ This action comments on the pull request with a report on the resulting change i
8
8
9
9
## Inputs
10
10
11
-
### `size-deltas-reports-artifact-name`
11
+
### `sketches-reports-source`
12
12
13
-
Name of the [workflow artifact](https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts) that contains the memory usage data, as specified to the [`actions/upload-artifact`](https://github.com/actions/upload-artifact) action via its `name` input.
13
+
**Default**: "size-deltas-reports"
14
14
15
-
**Default**: `"size-deltas-reports"`
15
+
The action can be used in two ways:
16
+
17
+
#### Run from a [scheduled workflow](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule)
18
+
19
+
Recommended for public repositories.
20
+
21
+
The use of a scheduled workflow is necessary in order for the action to have the [write permissions required to comment on pull requests submitted from forks](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token).
22
+
23
+
In this usage, the `sketches-reports-source` defines the name of the workflow artifact that contains the memory usage data, as specified to the [`actions/upload-artifact`](https://github.com/actions/upload-artifact) action via its `name` input.
24
+
25
+
#### Run from the same workflow as the [`arduino/compile-sketches`](https://github.com/arduino/compile-sketches) action
26
+
27
+
Recommended for private repositories.
28
+
29
+
If configured to trigger on a short interval, the scheduled workflow method can use a lot of GitHub Actions minutes, quickly using up the limited allotment provided by GitHub for private repositories (public repositories get unlimited free minutes). For this reason, it may be preferable to only run the action as needed.
30
+
31
+
In order to get reports for pull requests from forks, the ["Send write tokens to workflows from fork pull requests" setting](https://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#enabling-workflows-for-private-repository-forks) must be enabled.
32
+
33
+
If the "Send write tokens to workflows from fork pull requests" setting is not enabled but the ["Run workflows from fork pull requests" setting](https://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#enabling-workflows-for-private-repository-forks) is enabled, the workflow should be configured to only run the action when the pull request is not from a fork (`if: github.event.pull_request.head.repo.full_name == github.repository`). This will prevent workflow job failures that would otherwise be caused when the report creation failed due to not having the necessary write permissions.
34
+
35
+
In this usage, the `sketches-reports-source` defines the path to the folder containing the memory usage data, as specified to the [`actions/download-artifact`](https://github.com/actions/download-artifact) action via its `path` input.
16
36
17
37
### `github-token`
18
38
@@ -22,6 +42,8 @@ Name of the [workflow artifact](https://docs.github.com/en/actions/configuring-a
22
42
23
43
## Example usage
24
44
45
+
### Scheduled workflow
46
+
25
47
```yaml
26
48
on:
27
49
schedule:
@@ -49,3 +71,53 @@ jobs:
49
71
name: size-deltas-reports
50
72
path: size-deltas-reports
51
73
```
74
+
75
+
### Workflow triggered by `pull_request` event
76
+
77
+
```yaml
78
+
on: [push, pull_request]
79
+
env:
80
+
# It's convenient to set variables for values used multiple times in the workflow
Copy file name to clipboardExpand all lines: action.yml
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
name: 'Report Arduino Sketch Size Deltas'
2
2
description: 'Comments on the pull request with a report on the resulting change in memory usage of Arduino sketches'
3
3
inputs:
4
-
size-deltas-reports-artifact-name:
5
-
description: 'Name of the workflow artifact that contains the memory usage data, as specified to the actions/upload-artifact action via its name input'
4
+
sketches-reports-source:
5
+
description: 'When run from scheduled workflow, name of the workflow artifact that contains sketches reports. When run from a pull request triggered workflow, path to the folder containing sketches reports.'
6
6
default: 'size-deltas-reports'
7
7
github-token:
8
8
description: 'GitHub access token used to comment the memory usage comparison results to the PR thread'
0 commit comments