chore(ghaction): make auto-generated issues only from members
Signed-off-by: David Ko <dko@suse.com> Signed-off-by: davidko <dko@suse.com>
This commit is contained in:
parent
852cf2c3f0
commit
d87927ed85
29
.github/workflows/create-issue.yml
vendored
29
.github/workflows/create-issue.yml
vendored
@ -7,13 +7,22 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: contains(github.event.label.name, 'backport/')
|
if: contains(github.event.label.name, 'backport/')
|
||||||
steps:
|
steps:
|
||||||
|
- name: Is Longhorn Member
|
||||||
|
uses: tspascoal/get-user-teams-membership@v1.0.4
|
||||||
|
id: is-longhorn-member
|
||||||
|
with:
|
||||||
|
username: ${{ github.event.issue.user.login }}
|
||||||
|
organization: longhorn
|
||||||
|
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
||||||
- name: Get Backport Version
|
- name: Get Backport Version
|
||||||
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true'
|
||||||
uses: xom9ikk/split@v1
|
uses: xom9ikk/split@v1
|
||||||
id: split
|
id: split
|
||||||
with:
|
with:
|
||||||
string: ${{ github.event.label.name }}
|
string: ${{ github.event.label.name }}
|
||||||
separator: /
|
separator: /
|
||||||
- name: Check if Backport Issue Exists
|
- name: Check if Backport Issue Exists
|
||||||
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true'
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
id: if-backport-issue-exists
|
id: if-backport-issue-exists
|
||||||
with:
|
with:
|
||||||
@ -23,7 +32,7 @@ jobs:
|
|||||||
title-includes: |
|
title-includes: |
|
||||||
[BACKPORT][v${{ steps.split.outputs._1 }}]${{ github.event.issue.title }}
|
[BACKPORT][v${{ steps.split.outputs._1 }}]${{ github.event.issue.title }}
|
||||||
- name: Get Milestone Object
|
- name: Get Milestone Object
|
||||||
if: fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true' && fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
||||||
uses: longhorn/bot/milestone-action@master
|
uses: longhorn/bot/milestone-action@master
|
||||||
id: milestone
|
id: milestone
|
||||||
with:
|
with:
|
||||||
@ -31,7 +40,7 @@ jobs:
|
|||||||
repository: ${{ github.repository }}
|
repository: ${{ github.repository }}
|
||||||
milestone_name: v${{ steps.split.outputs._1 }}
|
milestone_name: v${{ steps.split.outputs._1 }}
|
||||||
- name: Get Labels
|
- name: Get Labels
|
||||||
if: fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true' && fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
||||||
id: labels
|
id: labels
|
||||||
run: |
|
run: |
|
||||||
RAW_LABELS="${{ join(github.event.issue.labels.*.name, ' ') }}"
|
RAW_LABELS="${{ join(github.event.issue.labels.*.name, ' ') }}"
|
||||||
@ -41,7 +50,7 @@ jobs:
|
|||||||
echo "LABELS: $LABELS"
|
echo "LABELS: $LABELS"
|
||||||
echo "::set-output name=labels::$LABELS"
|
echo "::set-output name=labels::$LABELS"
|
||||||
- name: Create Backport Issue
|
- name: Create Backport Issue
|
||||||
if: fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true' && fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
||||||
uses: dacbd/create-issue-action@v1
|
uses: dacbd/create-issue-action@v1
|
||||||
id: new-issue
|
id: new-issue
|
||||||
with:
|
with:
|
||||||
@ -54,7 +63,7 @@ jobs:
|
|||||||
milestone: ${{ fromJSON(steps.milestone.outputs.data).number }}
|
milestone: ${{ fromJSON(steps.milestone.outputs.data).number }}
|
||||||
assignees: ${{ join(github.event.issue.assignees.*.login, ', ') }}
|
assignees: ${{ join(github.event.issue.assignees.*.login, ', ') }}
|
||||||
- name: Get Repo Id
|
- name: Get Repo Id
|
||||||
if: fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true' && fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
||||||
uses: octokit/request-action@v2.x
|
uses: octokit/request-action@v2.x
|
||||||
id: repo
|
id: repo
|
||||||
with:
|
with:
|
||||||
@ -62,7 +71,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
- name: Add Backport Issue To Release
|
- name: Add Backport Issue To Release
|
||||||
if: fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true' && fromJSON(steps.if-backport-issue-exists.outputs.issues)[0] == null
|
||||||
uses: longhorn/bot/add-zenhub-release-action@master
|
uses: longhorn/bot/add-zenhub-release-action@master
|
||||||
with:
|
with:
|
||||||
zenhub_token: ${{ secrets.ZENHUB_TOKEN }}
|
zenhub_token: ${{ secrets.ZENHUB_TOKEN }}
|
||||||
@ -74,7 +83,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: contains(github.event.label.name, 'require/auto-e2e-test')
|
if: contains(github.event.label.name, 'require/auto-e2e-test')
|
||||||
steps:
|
steps:
|
||||||
|
- name: Is Longhorn Member
|
||||||
|
uses: tspascoal/get-user-teams-membership@v1.0.4
|
||||||
|
id: is-longhorn-member
|
||||||
|
with:
|
||||||
|
username: ${{ github.event.issue.user.login }}
|
||||||
|
organization: longhorn
|
||||||
|
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
||||||
- name: Check if Automation Issue Exists
|
- name: Check if Automation Issue Exists
|
||||||
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true'
|
||||||
uses: actions-cool/issues-helper@v3
|
uses: actions-cool/issues-helper@v3
|
||||||
id: if-automation-issue-exists
|
id: if-automation-issue-exists
|
||||||
with:
|
with:
|
||||||
@ -84,7 +101,7 @@ jobs:
|
|||||||
title-includes: |
|
title-includes: |
|
||||||
[TEST]${{ github.event.issue.title }}
|
[TEST]${{ github.event.issue.title }}
|
||||||
- name: Create Automation Test Issue
|
- name: Create Automation Test Issue
|
||||||
if: fromJSON(steps.if-automation-issue-exists.outputs.issues)[0] == null
|
if: steps.is-longhorn-member.outputs.isTeamMember == 'true' && fromJSON(steps.if-automation-issue-exists.outputs.issues)[0] == null
|
||||||
uses: dacbd/create-issue-action@v1
|
uses: dacbd/create-issue-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
|
Loading…
Reference in New Issue
Block a user