mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:31:43 +00:00
Make script more resilient to racing events (#31013)
This commit is contained in:
parent
d2b66247fa
commit
04d5326c1c
3
.github/workflows/project-automation.yml
vendored
3
.github/workflows/project-automation.yml
vendored
@ -2,7 +2,8 @@ name: "[OPTIONAL/DOESN'T BLOCK MERGING] Code Insights GitHub project automation"
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, closed, reopened, milestoned, labeled]
|
||||
# Note: labeled/milestoned is also triggered when opening a new issue with labels/milestone
|
||||
types: [closed, reopened, milestoned, labeled]
|
||||
pull_request:
|
||||
types: [opened, edited, synchronize, ready_for_review, converted_to_draft]
|
||||
|
||||
|
||||
6
.github/workflows/update-project-items.ps1
vendored
6
.github/workflows/update-project-items.ps1
vendored
@ -32,7 +32,7 @@ switch ($github.event_name) {
|
||||
|
||||
Write-Information "Issue was $($github.event.action)"
|
||||
|
||||
if ($github.event.action -in 'opened', 'labeled', 'milestoned') {
|
||||
if ($github.event.action -in 'labeled', 'milestoned') {
|
||||
# If issue was labeled, make sure to only consider the team label being added (don't send a Slack message for every label added).
|
||||
if ($github.event.action -eq 'labeled' -and $github.event.label.name -ne $TeamLabel) {
|
||||
Write-Information "Labeled with non-team label ($($github.event.label.name)), exiting."
|
||||
@ -44,12 +44,12 @@ switch ($github.event_name) {
|
||||
return
|
||||
}
|
||||
|
||||
# If team label was added or issue was just opened, add to project board
|
||||
# If team label was added, add to project board
|
||||
# If added to an iteration, update status and set "proposed by" to the event actor
|
||||
# Idempotent, will return the item if already exists in the board (this is fine because we checked for the team label)
|
||||
$item = [pscustomobject]$github.event.issue | Add-GitHubBetaProjectItem -ProjectNodeId $ProjectNodeId
|
||||
|
||||
if ($item.content.milestone) {
|
||||
if ($github.event.issue.milestone) {
|
||||
$proposer = $github.event.sender.login
|
||||
Write-Information "Updating issue as 'Proposed for iteration' by @$proposer"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user