Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci) - called add-to-projects workflow and referenced here #9812

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(ci) - called add-to-projects workflow and referenced here
Signed-off-by: Barun Debnath <barundebnath91@gmail.com>
  • Loading branch information
d-cryptic committed Nov 14, 2024
commit a25deb7aba30ddc1bd48bd42ef8cc561dc1a7705
66 changes: 3 additions & 63 deletions .github/workflows/add-to-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,6 @@ on:
types: [opened]

jobs:
community:
runs-on: ubuntu-latest
steps:
- name: Is Longhorn Member
id: is-longhorn-member
continue-on-error: true
uses: tspascoal/get-user-teams-membership@v3
with:
username: ${{ github.event.issue.user.login }}
organization: longhorn
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: Get Issue
if: steps.is-longhorn-member.outcome == 'success'
uses: octokit/request-action@v2.x
id: issue
with:
route: GET /repos/${{ github.repository }}/issues/${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: Add Issue to Community Sprint Project
id: add-project
if: |
steps.is-longhorn-member.outcome == 'success' &&
fromJSON(steps.is-longhorn-member.outputs.teams)[0] == null
uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/longhorn/projects/5
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: Update Item To New
if: |
steps.is-longhorn-member.outcome == 'success' &&
fromJSON(steps.is-longhorn-member.outputs.teams)[0] == null &&
steps.add-project.outputs.itemId != ''
uses: titoportas/update-project-fields@v0.1.0
with:
project-url: https://github.com/orgs/longhorn/projects/5
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
item-id: ${{ steps.add-project.outputs.itemId }}
field-keys: Status,Sprint
field-values: "New,[0]"

qa:
runs-on: ubuntu-latest
steps:
- name: Is Longhorn Member
id: is-longhorn-member
uses: tspascoal/get-user-teams-membership@v3
with:
username: ${{ github.event.issue.user.login }}
organization: longhorn
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: Add Issue to QA Sprint Project
if: fromJSON(steps.is-longhorn-member.outputs.teams)[0] != null
uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/longhorn/projects/4
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
labeled: kind/test, area/infra
label-operator: OR
call-add-to-projects-workflow:
uses: longhorn/gh-configs/.github/workflows/add-to-projects.yaml
secrets: inherit