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
|
||||
if: contains(github.event.label.name, 'backport/')
|
||||
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
|
||||
if: steps.is-longhorn-member.outputs.isTeamMember == 'true'
|
||||
uses: xom9ikk/split@v1
|
||||
id: split
|
||||
with:
|
||||
string: ${{ github.event.label.name }}
|
||||
separator: /
|
||||
- name: Check if Backport Issue Exists
|
||||
if: steps.is-longhorn-member.outputs.isTeamMember == 'true'
|
||||
uses: actions-cool/issues-helper@v3
|
||||
id: if-backport-issue-exists
|
||||
with:
|
||||
@ -23,7 +32,7 @@ jobs:
|
||||
title-includes: |
|
||||
[BACKPORT][v${{ steps.split.outputs._1 }}]${{ github.event.issue.title }}
|
||||
- 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
|
||||
id: milestone
|
||||
with:
|
||||
@ -31,7 +40,7 @@ jobs:
|
||||
repository: ${{ github.repository }}
|
||||
milestone_name: v${{ steps.split.outputs._1 }}
|
||||
- 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
|
||||
run: |
|
||||
RAW_LABELS="${{ join(github.event.issue.labels.*.name, ' ') }}"
|
||||
@ -41,7 +50,7 @@ jobs:
|
||||
echo "LABELS: $LABELS"
|
||||
echo "::set-output name=labels::$LABELS"
|
||||
- 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
|
||||
id: new-issue
|
||||
with:
|
||||
@ -54,7 +63,7 @@ jobs:
|
||||
milestone: ${{ fromJSON(steps.milestone.outputs.data).number }}
|
||||
assignees: ${{ join(github.event.issue.assignees.*.login, ', ') }}
|
||||
- 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
|
||||
id: repo
|
||||
with:
|
||||
@ -62,7 +71,7 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
- 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
|
||||
with:
|
||||
zenhub_token: ${{ secrets.ZENHUB_TOKEN }}
|
||||
@ -74,7 +83,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(github.event.label.name, 'require/auto-e2e-test')
|
||||
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
|
||||
if: steps.is-longhorn-member.outputs.isTeamMember == 'true'
|
||||
uses: actions-cool/issues-helper@v3
|
||||
id: if-automation-issue-exists
|
||||
with:
|
||||
@ -84,7 +101,7 @@ jobs:
|
||||
title-includes: |
|
||||
[TEST]${{ github.event.issue.title }}
|
||||
- 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
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
|
Loading…
Reference in New Issue
Block a user