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

Sheneska patch 2 #2520

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/review-assigner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Reviewer Assigner"

on:
pull_request:
types: [opened]
issues:
types: [opened]

jobs:
create-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
- run: npm install @pagerduty/pdjs
- uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 # v7.0.0
env:
PAGERDUTY_TOKEN: ${{ secrets.PAGERDUTY_TOKEN }}
with:
script: |
const { PAGERDUTY_TOKEN } = process.env
const { api } = require('@pagerduty/pdjs');
const pd = api({token: PAGERDUTY_TOKEN});
pd.get('/schedules/id/users')
.then((response) => {
console.log("Assigning to " + response.users);
}).catch(console.error)
console.log("triggered by: " + context.eventName)
if (context.eventName == "issues"){
try{
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
assignees: ["BBBmau"], // this will be replaced with pagerduty resp
issue_number: context.issue.number, // issue.number is used for both issues and PRs
})
} catch(error){
core.setFailed("error assigning assignee:" + error)
}
}
if (context.eventName == "pull_request"){
try{
await github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
reviewers: ["BBBmau"], // this will be replaced with pagerduty resp
pull_number: (context.issue.number - 1), // for some reason we get PR+1 from context
})
} catch(error){
core.setFailed("error assigning reviewer:" + error)
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src=".github/tf.png" alt="Terraform logo" title="Terraform" align="left" height="50" />
</a>

# Kubernetes Provider for Terraform [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/hashicorp/terraform-provider-kubernetes?label=release)](https://github.com/hashicorp/terraform-provider-kubernetes/releases) [![license](https://img.shields.io/github/license/hashicorp/terraform-provider-kubernetes.svg)]()
# Shen Kubernetes Provider for Terraform [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/hashicorp/terraform-provider-kubernetes?label=release)](https://github.com/hashicorp/terraform-provider-kubernetes/releases) [![license](https://img.shields.io/github/license/hashicorp/terraform-provider-kubernetes.svg)]()

- [Getting Started](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/guides/getting-started)
- [Interactive Tutorial](https://learn.hashicorp.com/tutorials/terraform/kubernetes-provider?in=terraform/kubernetes)
Expand Down
Loading