Skip to content

Commit

Permalink
CI: Use more permissive regex in author_approval.yml (#99796)
Browse files Browse the repository at this point in the history
* Use more permissive regex in `author_approval.yml`

* Update .github/workflows/author_approval.yml

* Update .github/workflows/author_approval.yml
  • Loading branch information
ericphanson authored Jan 29, 2024
1 parent b5b0067 commit e3a279f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/author_approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ jobs:
COMMENTER: ${{ github.event.comment.user.login }}
shell: julia --compile=min --optimize=0 --color=yes {0}
run: |
m = match(r"Created by: @([A-Za-z0-9]*+)(?:$|\n)", ENV["PR_BODY"])
isempty(ENV["COMMENTER"]) && error("COMMENTER is empty")
if length(ENV["COMMENTER"]) != length(strip(ENV["COMMENTER"]))
error("COMMENTER has leading or lagging whitespace")
end
m = match(r"Created by: @(\S+)", ENV["PR_BODY"])
verified = !isnothing(m) && m[1] == ENV["COMMENTER"]
println("Matched user: ", m === nothing ? nothing : m[1])
println("Commenter: ", ENV["COMMENTER"])
Expand Down

0 comments on commit e3a279f

Please sign in to comment.