ci: refine community project action and add qa project action

Signed-off-by: Yang Chiu <yang.chiu@suse.com>
This commit is contained in:
Yang Chiu 2022-11-03 11:08:34 +08:00 committed by David Ko
parent cc043c43d1
commit 22daa08f60
3 changed files with 32 additions and 60 deletions

View File

@ -1,36 +0,0 @@
name: Add issues to projects
on:
issues:
types:
- labeled
- opened
jobs:
add-to-qa-devops-project:
name: Add issue to QA & DevOps project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.3.0
with:
project-url: https://github.com/orgs/longhorn/projects/4
github-token: ${{ secrets.GITHUB_TOKEN }}
labeled: kind/test, area/test-infra
label-operator: OR
add-to-community-project:
name: Add issue to Community project
runs-on: ubuntu-latest
steps:
- uses: JamesSingleton/is-organization-member@1.0.0
id: is_organization_member
if: github.event.action == 'opened'
with:
organization: longhorn
username: ${{ github.event.issue.user.login }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/add-to-project@v0.3.0
if: steps.is_organization_member.outputs.result == false
with:
project-url: https://github.com/orgs/longhorn/projects/5
github-token: ${{ secrets.GITHUB_TOKEN }}

32
.github/workflows/add-to-projects.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Add-To-Projects
on:
issues:
types: [opened, labeled]
jobs:
community:
runs-on: ubuntu-latest
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: Add To Community Project
if: fromJSON(steps.is-longhorn-member.outputs.teams)[0] == null
uses: actions/add-to-project@v0.3.0
with:
project-url: https://github.com/orgs/longhorn/projects/5
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
qa:
runs-on: ubuntu-latest
steps:
- name: Add To QA & Devops Project
uses: actions/add-to-project@v0.3.0
with:
project-url: https://github.com/orgs/longhorn/projects/4
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
labeled: kind/test, area/test-infra
label-operator: OR

View File

@ -1,24 +0,0 @@
name: Community-Issue
on:
issues:
types: [opened]
jobs:
community:
runs-on: ubuntu-latest
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: Add To Community Project
if: fromJSON(steps.is-longhorn-member.outputs.teams)[0] == null
uses: leonsteinhaeuser/project-beta-automations@v1.2.1
with:
gh_token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
organization: longhorn
project_id: 5
resource_node_id: ${{ github.event.issue.node_id }}
status_value: New