forked from flux-iac/tofu-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Allow drift detection for new objects in drift-detection mode flu…
- Loading branch information
1 parent
6e54e9e
commit 0c92c8f
Showing
78 changed files
with
15,678 additions
and
16,822 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Wild Watermelon Blocked Issue Reminder on Slack | ||
on: | ||
workflow_dispatch: | ||
# schedule: | ||
# # Poke on Monday to kick off the week, and on Thu so we have time to poke | ||
# # others on Fri. | ||
# - cron: '0 15 * * 1,4' | ||
|
||
permissions: | ||
issues: read # for actions/github-script to query issues | ||
|
||
jobs: | ||
issue-list: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: List Issues | ||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | ||
id: list-issues | ||
with: | ||
script: | | ||
// Use the label that filters down issues the most in the | ||
// initial query. | ||
const baseLabel = 'blocked'; | ||
// "AND" logic, so all labels has to be on the issue. | ||
// This is required because the GrqphQL API uses "OR" if we | ||
// specify more than one label in the query. | ||
const extraLabels = ['team/wild-watermelon']; | ||
const query = `query($owner:String!, $name:String!, $label:String!) { | ||
repository(owner:$owner, name:$name){ | ||
issues(first:100, labels: [$label], states: [OPEN]) { | ||
nodes { | ||
title, number, url, | ||
labels(first: 20) { | ||
nodes { name id } | ||
} | ||
} | ||
} | ||
} | ||
}`; | ||
const variables = { | ||
owner: context.repo.owner, | ||
name: context.repo.repo, | ||
label: baseLabel | ||
} | ||
const result = await github.graphql(query, variables) | ||
const lines = result.repository.issues.nodes.map(issue => { | ||
const labels = issue.labels.nodes.map(label => label.name) | ||
const matchingLabels = labels.filter(label => { | ||
return extraLabels.indexOf(label) !== -1; | ||
}); | ||
if (matchingLabels.length !== extraLabels.length) { | ||
return null; | ||
} | ||
return [ | ||
" * ", | ||
"<", issue.url, "|", issue.title.replace(/[<>]/g, ''), ">", | ||
" (", labels.map(n => '`'+n+'`').join(", "), ")" | ||
].join('') | ||
}).filter(line => line !== null) | ||
if (lines.length < 1) { | ||
return "" | ||
} | ||
const header = [ | ||
":old-man-yells-at-cloud: All issues on", "`" + context.repo.owner + "/" + context.repo.repo + "`", | ||
"marked with:", [baseLabel, ...extraLabels].map(n => '`'+n+'`').join(", ") | ||
].join(" ") | ||
return [header, lines.join("\n")].join("\n\n") | ||
result-encoding: string | ||
- name: Send issues to Slack | ||
uses: archive/github-actions-slack@d9dae40827adf93bddf939db6552d1e392259d7d # v2.7.0 | ||
if: ${{ steps.list-issues.outputs.result != '' }} | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.WEAVEWORKS_SLACK_GENERICBOT_TOKEN }} | ||
slack-channel: C0586V3N0BG # team-wild-watermelon | ||
slack-text: ${{steps.list-issues.outputs.result}} | ||
slack-optional-icon_url: "https://avatars.githubusercontent.com/u/9976052" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.