Commit 7820cba
Combine access token and pull request checks in workflow (#380)
# Motivation
In #368 I changed to an earlier
version of `EndBug/add-and-commit` to avoid having to pass `ref` to the
`checkout` action depending on whether the run if for a PR to avoid
having to have 4 different checkout steps.
I realized that I only need to pass the token if I plan to make changes,
so I can combine the checkout steps and still only have 2 while also
using newer versions of `actions/checkout` and `EndBug/add-and-commit`.
# Changes
1. Check whether commits can be added based on both the presence of the
PAT token and the even being for a PR.
2. Use `actions/checkout@v4` and `EndBug/[email protected]`.
# Tested
[PR](#381) from a forked repo:
* Without formatting changes required:
https://github.com/dfinity/snsdemo/actions/runs/10040798640/job/27747555323?pr=381
* With formatting changes required:
https://github.com/dfinity/snsdemo/actions/runs/10040830499/job/27747653098?pr=381
From this PR:
* Without formatting changes required:
https://github.com/dfinity/snsdemo/actions/runs/10040798640/job/27747555323?pr=380
* With formatting changes required:
https://github.com/dfinity/snsdemo/actions/runs/10040829788/job/27747650644
* Automatic follow-up after commit:
https://github.com/dfinity/snsdemo/actions/runs/10040837356/job/27747673570?pr=380
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>1 parent 4f2eaa1 commit 7820cba
1 file changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
49 | | - | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
61 | | - | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
0 commit comments