Skip to content

Commit 739672c

Browse files
authored
Rollup merge of #138223 - Kobzol:fix-post-merge, r=marcoieni
Fix post-merge workflow I forgot that `actions/checkout` only checks out a single commit by default. I also forgot to set the environment variable required for the `gh` CLI commands. I did a few more tests on my fork and hopefully now it should work properly. I also tested it with fake rollup PRs and the comment was sent only to the merged rollup, as it should be. r? `@marcoieni`
2 parents 69c7e36 + ff67423 commit 739672c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: .github/workflows/post-merge.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ jobs:
1616
pull-requests: write
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
# Make sure that we have enough commits to find the parent merge commit.
21+
# Since all merges should be through merge commits, fetching two commits
22+
# should be enough to get the parent bors merge commit.
23+
fetch-depth: 2
1924
- name: Perform analysis and send PR
25+
env:
26+
GH_TOKEN: ${{ github.token }}
2027
run: |
2128
# Get closest bors merge commit
2229
PARENT_COMMIT=`git rev-list --author='bors <[email protected]>' -n1 --first-parent HEAD^1`
30+
echo "Parent: ${PARENT_COMMIT}"
2331
2432
# Find PR for the current commit
2533
HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`
26-
27-
echo "Parent: ${PARENT_COMMIT}"
2834
echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"
2935
3036
cd src/ci/citool

0 commit comments

Comments
 (0)