-
-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fixed the notify triager workflow #3460
base: master
Are you sure you want to change the base?
Changes from 3 commits
76fd8e4
e230dde
02b18ed
aadb343
abdc1f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,10 @@ jobs: | |
- name: Get commit message | ||
id: commit-message | ||
run: | | ||
# Extract the commit message | ||
commit_message=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }}) | ||
commit_message=$(echo "$commit_message" | tr '\n' ' ') | ||
commit_message=$(echo "$commit_message" | sed 's/[<>|]//g' | sed 's/[][]//g' | sed 's/(//g' | sed 's/)//g' | xargs) | ||
echo "commit_message=$commit_message" >> $GITHUB_OUTPUT | ||
|
||
- name: Check if last commit is a merge commit | ||
|
@@ -34,19 +37,17 @@ jobs: | |
- name: Checkout asyncapi/website Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Get all changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 | ||
|
||
- name: Check PR Changes for .md files | ||
id: md-pr-changes | ||
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0 | ||
with: | ||
files: | | ||
**.md | ||
|
||
- name: Check PR Changes for non-.md files | ||
id: non-md-pr-changes | ||
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0 | ||
with: | ||
files: | | ||
!**.md | ||
|
||
|
||
|
||
- name: Extract Doc Triage Maintainers | ||
|
@@ -68,7 +69,7 @@ jobs: | |
echo "codeTriagers=$codeTriagers" >> $GITHUB_ENV | ||
|
||
- name: Add Reviewers for code files | ||
if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.non-md-pr-changes.outputs.any_changed == 'true' | ||
if: ${{ steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.changed-files.outputs.all_changed_files_count != steps.md-pr-changes.outputs.all_changed_files_count }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this we are checking for non md files There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tj-actions doesn't have any mechanism for non md files so that's why I implemented this or else we need to check for many file extensions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. Good catch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though I am still curious about the ambigious behavior of this workflow. For example, examine this PR See how MD triagers are getting assigned as PR reviewers even though there was no merge commit or a MD file change Another instance of this issue: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/asyncapi/website/actions/runs/11141478939/job/30962427072 I think this job was surpassed |
||
run: | | ||
IFS=' ' read -r -a codeTriagers <<< "${{ env.codeTriagers }}" | ||
reviewers=$(printf ', "%s"' "${codeTriagers[@]}") | ||
|
@@ -83,7 +84,7 @@ jobs: | |
}" | ||
|
||
- name: Add Reviewers for doc files | ||
if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.md-pr-changes.outputs.any_changed == 'true' | ||
if: ${{ steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.md-pr-changes.outputs.any_changed == 'true' }} | ||
run: | | ||
IFS=' ' read -r -a docTriagers <<< "${{ env.docTriagers }}" | ||
reviewers=$(printf ', "%s"' "${docTriagers[@]}") | ||
|
@@ -96,3 +97,4 @@ jobs: | |
-d "{ | ||
\"reviewers\": $reviewers | ||
}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use version tags instead of commit hashes for action versions.
Using a specific commit hash (
aa08304bd477b800d468db44fe10f6c61f7f7b11
) for the action version is risky as the commit could be force-pushed or deleted. The AI summary indicates that this should be usingv45
.📝 Committable suggestion