From 22daa08f603b190dfd6c021fc311e25c6d51d5da Mon Sep 17 00:00:00 2001 From: Yang Chiu Date: Thu, 3 Nov 2022 11:08:34 +0800 Subject: [PATCH] ci: refine community project action and add qa project action Signed-off-by: Yang Chiu --- .github/workflows/add-to-projects.yaml | 36 -------------------------- .github/workflows/add-to-projects.yml | 32 +++++++++++++++++++++++ .github/workflows/community-issue.yml | 24 ----------------- 3 files changed, 32 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/add-to-projects.yaml create mode 100644 .github/workflows/add-to-projects.yml delete mode 100644 .github/workflows/community-issue.yml diff --git a/.github/workflows/add-to-projects.yaml b/.github/workflows/add-to-projects.yaml deleted file mode 100644 index 5b5bdb6..0000000 --- a/.github/workflows/add-to-projects.yaml +++ /dev/null @@ -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 }} diff --git a/.github/workflows/add-to-projects.yml b/.github/workflows/add-to-projects.yml new file mode 100644 index 0000000..a4d58f2 --- /dev/null +++ b/.github/workflows/add-to-projects.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/community-issue.yml b/.github/workflows/community-issue.yml deleted file mode 100644 index f40b4a7..0000000 --- a/.github/workflows/community-issue.yml +++ /dev/null @@ -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