forked from rapidsai/cudf
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (76 loc) · 3.4 KB
/
pr_issue_status_automation.yml
File metadata and controls
83 lines (76 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Set PR and Issue Project Fields
on: # zizmor: ignore[dangerous-triggers]
pull_request_target:
# This job runs when a PR is first opened, or it is updated
# Only runs if the PR is open (we don't want to update the status of a closed PR)
types: [opened, edited, synchronize]
permissions: {}
jobs:
get-project-id:
uses: rapidsai/shared-workflows/.github/workflows/project-get-item-id.yaml@main
secrets:
ADD_TO_PROJECT_GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_GITHUB_TOKEN }}
if: github.event.pull_request.state == 'open'
permissions:
contents: read
with:
PROJECT_ID: "PVT_kwDOAp2shc4AiNzl"
ITEM_NODE_ID: "${{ github.event.pull_request.node_id }}"
update-status:
# This job sets the PR and its linked issues to "In Progress" status
uses: rapidsai/shared-workflows/.github/workflows/project-get-set-single-select-field.yaml@main
secrets:
ADD_TO_PROJECT_GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_GITHUB_TOKEN }}
if: ${{ github.event.pull_request.state == 'open' && needs.get-project-id.outputs.ITEM_PROJECT_ID != '' }}
needs: get-project-id
permissions:
contents: read
with:
PROJECT_ID: "PVT_kwDOAp2shc4AiNzl"
SINGLE_SELECT_FIELD_ID: "PVTSSF_lADOAp2shc4AiNzlzgaxNac"
SINGLE_SELECT_FIELD_NAME: "Status"
SINGLE_SELECT_OPTION_VALUE: "In Progress"
ITEM_PROJECT_ID: "${{ needs.get-project-id.outputs.ITEM_PROJECT_ID }}"
ITEM_NODE_ID: "${{ github.event.pull_request.node_id }}"
UPDATE_ITEM: true
UPDATE_LINKED_ISSUES: true
get-release:
if: ${{ github.event.pull_request.state == 'open' && needs.get-project-id.outputs.ITEM_PROJECT_ID != '' }}
needs: get-project-id
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
release: ${{ steps.get-release.outputs.release }}
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.base.ref }}
- name: Extract version from VERSION file
id: get-release
run: |
version=$(cat VERSION)
release=${version%.*}
echo "release=$release" >> "$GITHUB_OUTPUT"
update-release:
# This job sets the PR and its linked issues to the release they are targeting
uses: rapidsai/shared-workflows/.github/workflows/project-get-set-single-select-field.yaml@main
secrets:
ADD_TO_PROJECT_GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_GITHUB_TOKEN }}
if: ${{ github.event.pull_request.state == 'open' && needs.get-project-id.outputs.ITEM_PROJECT_ID != '' }}
needs: [get-project-id, get-release]
permissions:
contents: read
with:
PROJECT_ID: "PVT_kwDOAp2shc4AiNzl"
SINGLE_SELECT_FIELD_ID: "PVTSSF_lADOAp2shc4AiNzlzgg52UQ"
SINGLE_SELECT_FIELD_NAME: "Release"
SINGLE_SELECT_OPTION_VALUE: "${{ needs.get-release.outputs.release }}"
ITEM_PROJECT_ID: "${{ needs.get-project-id.outputs.ITEM_PROJECT_ID }}"
ITEM_NODE_ID: "${{ github.event.pull_request.node_id }}"
UPDATE_ITEM: true
UPDATE_LINKED_ISSUES: true