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

GH Infra: project automation and issue template fixes #297

Merged
merged 5 commits into from
Aug 16, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: Create a report to help us improve
title: '[BUG]: '
labels: ['Bug']
labels: ['bug']
body:
- type: checkboxes
id: check-duplicates
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/doc_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Documentation Request
description: Suggest an idea to improve CCCL
title: '[DOC]: '
labels: ['Doc']
labels: ['doc']

body:
- type: checkboxes
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature Request
description: Suggest an idea to improve CCCL
title: '[FEA]: '
labels: ['Feature']
labels: ['feature request']
body:
- type: checkboxes
id: check-duplicates
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/project_automation_set_in_progress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ env:
jobs:
query_and_mutate_project_fields:
runs-on: ubuntu-latest

permissions:
issues: write
pull-requests: write

steps:
- name: Check if changes requested from a reviewer
Expand All @@ -51,8 +55,20 @@ jobs:
if [ ${{ github.event.review.state }} != 'changes_requested' ]; then
echo "Changes not requested, exiting"
exit 0

# If it is requesting changes, set PR to draft
# We use the default token here since we're granting write access to the PR
elif [ ${{ github.event.pull_request.draft }} == true ]; then
gh api graphql -f query='
mutation {
convertPullRequestToDraft(input: {pullRequestId: "${{ env.PR_GLOBAL_ID }}"}) {
clientMutationId
}
}'
exit 0
fi
fi
continue-on-error: true

- name: Generate token
id: generate_token
Expand Down Expand Up @@ -334,19 +350,3 @@ jobs:
fi
done
continue-on-error: true

- name: set PR to draft
id: set_pr_draft
# only run if PR is not a draft
if: ${{ github.event.pull_request.draft }} == false
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
# Set the PR to draft using the graphQL API
gh api graphql -f query='
mutation {
convertPullRequestToDraft(input: {pullRequestId: "${{ env.PR_GLOBAL_ID }}"}) {
clientMutationId
}
}'
continue-on-error: true
Loading