24
24
update :
25
25
name : update dependencies
26
26
runs-on : ubuntu-latest
27
- outputs :
28
- lock : ${{ steps.lock.outputs.lock }}
29
- upgrades : ${{ steps.upgrades.outputs.upgrades }}
30
27
steps :
31
28
- name : checkout the source code
32
29
uses : actions/checkout@v3
@@ -42,31 +39,22 @@ jobs:
42
39
43
40
- name : cargo update
44
41
run : cargo update
45
- - name : output Cargo.lock for use in PR
46
- id : lock
47
- run : |
48
- # Read Cargo.lock into an output
49
- LOCK="$(cat Cargo.lock)"
50
- # Escape LF/CR because outputs must be a single line
51
- LOCK="${LOCK//'%'/'%25'}"
52
- LOCK="${LOCK//$'\n'/'%0A'}"
53
- LOCK="${LOCK//$'\r'/'%0D'}"
54
- echo "lock=${LOCK}" >> "$GITHUB_OUTPUT"
42
+ - name : upload Cargo.lock artifact for use in PR
43
+ uses : actions/upload-artifact@v3
44
+ with :
45
+ name : Cargo-lock
46
+ path : Cargo.lock
47
+ retention-days : 1
55
48
56
49
- name : cargo upgrades
57
50
# cargo-upgrade exits 7 if upgrades are available, ignore that
58
51
run : cargo upgrades > cargo_upgrades.stdout || exit 0
59
52
- name : output upgrades for use in PR
60
- id : upgrades
61
- run : |
62
- # Read cargo_upgrades.stdout into an output
63
- # Convert absolute paths to relative paths
64
- UPGRADES="$(sed "s#$(pwd)/##" cargo_upgrades.stdout)"
65
- # Escape LF/CR because outputs must be a single line
66
- UPGRADES="${UPGRADES//'%'/'%25'}"
67
- UPGRADES="${UPGRADES//$'\n'/'%0A'}"
68
- UPGRADES="${UPGRADES//$'\r'/'%0D'}"
69
- echo "upgrades=${UPGRADES}" >> "$GITHUB_OUTPUT"
53
+ uses : actions/upload-artifact@v3
54
+ with :
55
+ name : cargo-upgrades
56
+ path : cargo-upgrades.stdout
57
+ retention-days : 1
70
58
71
59
pr :
72
60
name : amend PR
@@ -79,28 +67,20 @@ jobs:
79
67
- name : checkout the source code
80
68
uses : actions/checkout@v3
81
69
82
- - name : get Cargo.lock from update job
83
- env :
84
- LOCK : ${{ needs.update.outputs.lock }}
85
- run : |
86
- # Un-escape
87
- LOCK="${LOCK//'%0D'/$'\r'}"
88
- LOCK="${LOCK//'%0A'/$'\n'}"
89
- LOCK="${LOCK//'%25'/'%'}"
90
- # Write to file
91
- echo "${LOCK}" > Cargo.lock
70
+ - name : download Cargo.lock from update job
71
+ uses : actions/download-artifact@v3
72
+ with :
73
+ name : Cargo-lock
74
+ - name : download cargo-upgrades from update job
75
+ uses : actions/download-artifact@v3
76
+ with :
77
+ name : cargo-upgrades
78
+
92
79
- name : craft PR body
93
- env :
94
- UPGRADES : ${{ needs.update.outputs.upgrades }}
95
80
run : |
96
- # Un-escape
97
- UPGRADES="${UPGRADES//'%0D'/$'\r'}"
98
- UPGRADES="${UPGRADES//'%0A'/$'\n'}"
99
- UPGRADES="${UPGRADES//'%25'/'%'}"
100
-
101
81
echo "${PR_MESSAGE}" > body.md
102
82
echo '```txt' >> body.md
103
- echo "${UPGRADES}" >> body.md
83
+ cat cargo-upgrades.stdout >> body.md
104
84
echo '```' >> body.md
105
85
106
86
- name : edit and reopen existing pull request
0 commit comments