Skip to content

Commit d50d28f

Browse files
add gh app, change autocommit to verified-bot-commit (OpenZeppelin#359)
1 parent d18114b commit d50d28f

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

.github/workflows/prepare-release.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@ jobs:
1818
with:
1919
egress-policy: audit
2020

21+
- name: Get github app token
22+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
23+
id: gh-app-token
24+
with:
25+
app-id: ${{ vars.GH_APP_ID }}
26+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
27+
2128
- name: Checkout repository
2229
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
with:
31+
token: ${{ steps.gh-app-token.outputs.token }}
2332

2433
- name: Enable Corepack
2534
run: corepack enable
@@ -90,7 +99,23 @@ jobs:
9099
find ./contracts/src/ -type d -name '.*' -prune -o \
91100
-type f -exec sed -Ei "s#${ESCAPED_CURRENT}${VERSION_SUFFIX}#$ESCAPED_NEW#g" {} +
92101
93-
- name: Auto-commit changes
94-
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 #v7.1.0
102+
- name: Collect changed files
103+
id: changes
104+
run: |
105+
echo "Changed files:"
106+
git diff --name-only
107+
108+
{
109+
echo 'files<<EOF'
110+
git diff --name-only
111+
echo 'EOF'
112+
} >> "$GITHUB_OUTPUT"
113+
114+
# Uses GitHub API to create signed commits (requires creating blobs per file)
115+
- name: Commit version bump
116+
uses: iarekylew00t/verified-bot-commit@d7e8eea1f154881e1f9d70a3fd933e740148b7f4 # v2.1.1
95117
with:
96-
commit_message: Bump version to ${{ env.NEW_VERSION }}
118+
message: Bump version to ${{ env.NEW_VERSION }}
119+
token: ${{ steps.gh-app-token.outputs.token }}
120+
ref: ${{ github.ref_name }}
121+
files: ${{ steps.changes.outputs.files }}

0 commit comments

Comments
 (0)