Skip to content

Commit 7fb31ad

Browse files
authored
[ci] Fix bug where PR labels are not added (#2782)
* [ci] Fix bug where PR labels are not added * [ci] Update release-crate-version.yml
1 parent c6932f4 commit 7fb31ad

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.github/workflows/release-crate-version.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ on:
1818
required: true
1919
default: 'main'
2020

21-
permissions: read-all
21+
permissions:
22+
contents: read
23+
pull-requests: write
2224

2325
jobs:
2426
release:
@@ -34,13 +36,19 @@ jobs:
3436
run: ./ci/release_crate_version.sh ${{ github.event.inputs.version }}
3537

3638
- name: Submit PR
39+
id: submit-pr
3740
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
3841
with:
3942
commit-message: "Release ${{ github.event.inputs.version }}"
4043
author: Google PR Creation Bot <github-pull-request-creation-bot@google.com>
4144
committer: Google PR Creation Bot <github-pull-request-creation-bot@google.com>
4245
title: "Release ${{ github.event.inputs.version }}"
43-
labels: hide-from-release-notes
4446
branch: release-${{ github.event.inputs.version }}
4547
push-to-fork: google-pr-creation-bot/zerocopy
4648
token: ${{ secrets.GOOGLE_PR_CREATION_BOT_TOKEN }}
49+
50+
- name: Add labels
51+
if: steps.submit-pr.outputs.pull-request-operation == 'created'
52+
run: gh pr edit "${{ steps.submit-pr.outputs.pull-request-number }}" --add-label "hide-from-release-notes"
53+
env:
54+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/roll-pinned-toolchain-versions.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ on:
2222
- cron: '29 09 * * 1'
2323
workflow_dispatch:
2424

25-
permissions: read-all
25+
permissions:
26+
contents: read
27+
pull-requests: write
2628

2729
jobs:
2830
roll_rust:
@@ -131,6 +133,7 @@ jobs:
131133
fi
132134
133135
- name: Submit PR
136+
id: submit-pr
134137
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
135138
with:
136139
commit-message: "[ci] Roll pinned ${{ matrix.toolchain }} toolchain"
@@ -141,6 +144,13 @@ jobs:
141144
branch: roll-pinned-${{ matrix.toolchain }}-toolchain-to-${{ env.ZC_VERSION_FOR_BRANCH_NAME }}-for-${{ matrix.branch }}
142145
push-to-fork: google-pr-creation-bot/zerocopy
143146
token: ${{ secrets.GOOGLE_PR_CREATION_BOT_TOKEN }}
147+
148+
- name: Add labels
149+
if: steps.submit-pr.outputs.pull-request-operation == 'created'
150+
run: gh pr edit "${{ steps.submit-pr.outputs.pull-request-number }}" --add-label "hide-from-release-notes"
151+
env:
152+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
144154
roll_kani:
145155
runs-on: ubuntu-latest
146156
strategy:
@@ -165,13 +175,19 @@ jobs:
165175
# Update the `kani-version:` argument in-place.
166176
sed -i -E -e "s/^( *kani-version:)( [0-9]+\.[0-9]+\.[0-9]+)/\1 $KANI_LATEST/" .github/workflows/ci.yml
167177
- name: Submit PR
178+
id: submit-pr
168179
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
169180
with:
170181
commit-message: "[ci] Roll pinned Kani version"
171182
author: Google PR Creation Bot <github-pull-request-creation-bot@google.com>
172183
committer: Google PR Creation Bot <github-pull-request-creation-bot@google.com>
173184
title: "[ci] Roll pinned Kani version"
174-
labels: hide-from-release-notes
175185
branch: roll-pinned-kani-to-${{ env.ZC_KANI_LATEST }}-for-${{ matrix.branch }}
176186
push-to-fork: google-pr-creation-bot/zerocopy
177187
token: ${{ secrets.GOOGLE_PR_CREATION_BOT_TOKEN }}
188+
189+
- name: Add labels
190+
if: steps.submit-pr.outputs.pull-request-operation == 'created'
191+
run: gh pr edit "${{ steps.submit-pr.outputs.pull-request-number }}" --add-label "hide-from-release-notes"
192+
env:
193+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)