Skip to content
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

Support filtering Slack notification #16

Closed
kiootic opened this issue Feb 1, 2023 · 5 comments
Closed

Support filtering Slack notification #16

kiootic opened this issue Feb 1, 2023 · 5 comments
Assignees

Comments

@kiootic
Copy link
Collaborator

kiootic commented Feb 1, 2023

/gha subscribe <repo> <conclusions>

conclusion: cancelled, failure, success, timed_out, etc, ref: https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run

For example:

  • subscribe only successful runs: /gha subscribe oursky/github-actions-manager success
  • subscribe only successful runs: /gha subscribe oursky/github-actions-manager failure,timed_out
@limouren limouren self-assigned this Feb 1, 2023
@josephchow102 josephchow102 self-assigned this Feb 2, 2023
josephchow102 added a commit to josephchow102/github-actions-manager that referenced this issue Feb 3, 2023
josephchow102 added a commit to josephchow102/github-actions-manager that referenced this issue Feb 3, 2023
josephchow102 added a commit to josephchow102/github-actions-manager that referenced this issue Feb 6, 2023
josephchow102 added a commit to josephchow102/github-actions-manager that referenced this issue Feb 6, 2023
josephchow102 added a commit to josephchow102/github-actions-manager that referenced this issue Feb 7, 2023
josephchow102 added a commit to josephchow102/github-actions-manager that referenced this issue Feb 8, 2023
@limouren
Copy link

limouren commented Mar 1, 2024

I tried it out today. Seems multiple conclusions is not supported (/gha subscribe oursky/github-actions-manager failure,timed_out), but doing it individually works:

/gha subscribe oursky/github-actions-manager failure
/gha subscribe oursky/github-actions-manager timed_out

@kiootic
Copy link
Collaborator Author

kiootic commented Mar 1, 2024

I think it is space separated, try /gha subscribe oursky/github-actions-manager failure timed_out?

ref:

args := strings.Split(data.Text, " ")
if len(args) < 2 {
client.Ack(*e.Request, map[string]interface{}{
"text": fmt.Sprintf("Please specify subcommand and repo")})
return
}
repo := args[1]
subcommand := args[0]
conclusions := array.Unique(args[2:])
if !repoRegex.MatchString(repo) {
client.Ack(*e.Request, map[string]interface{}{
"text": fmt.Sprintf("Invalid repo '%s'\n", repo),
})
return
}

@aekt
Copy link

aekt commented Aug 1, 2024

Can we also support filtering by workflow/branch? Because want to ignore action results for CI and only notify for CD results 😀

@cychiuae
Copy link
Contributor

cychiuae commented Aug 1, 2024

superseded by #21

@cychiuae
Copy link
Contributor

cychiuae commented Aug 1, 2024

I think this issue has served its purpose.

@cychiuae cychiuae closed this as completed Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants