Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
feat: add project issues workflow, remove intake
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Basty committed Jun 9, 2023
1 parent f73f16c commit d532305
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 42 deletions.
88 changes: 46 additions & 42 deletions .github/workflows/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,50 @@
# When WalletConnect Org members create issues they
# are automatically "accepted".
# Else they need to manually receive that label during intake.
name: intake
#
# Currently, this workflow is not used.

on:
issues:
types: [opened, labeled]
pull_request:
types: [opened, labeled]

jobs:
add-to-project:
name: Add issue to board
if: github.event.action == 'labeled' && github.event.label.name == 'accepted'
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.1.0
with:
project-url: https://github.com/orgs/WalletConnect/projects/9
github-token: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
labeled: accepted
label-operator: OR
auto-promote:
name: auto-promote
if: github.event.action == 'opened'
runs-on: ubuntu-latest
steps:
- name: Check Core Team membership
uses: tspascoal/get-user-teams-membership@v1
id: is-core-team
with:
username: ${{ github.event_name != 'pull_request' && github.event.issue.user.login || github.event.sender.login }}
team: "Core Team"
GITHUB_TOKEN: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
- name: Print result
env:
CREATOR: ${{ github.event_name != 'pull_request' && github.event.issue.user.login || github.event.sender.login }}
IS_TEAM_MEMBER: ${{ steps.is-core-team.outputs.isTeamMember }}
run: echo "$CREATOR (Core Team Member $IS_TEAM_MEMBER) created this issue/PR"
- name: Label issues
if: ${{ steps.is-core-team.outputs.isTeamMember == 'true' }}
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with:
add-labels: "accepted"
repo-token: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
#name: Intake
#
#on:
# issues:
# types: [opened, labeled]
# pull_request:
# types: [opened, labeled]
#
#jobs:
# add-to-project:
# name: Add issue to board
# if: github.event.action == 'labeled' && github.event.label.name == 'accepted'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/add-to-project@v0.1.0
# with:
# project-url: https://github.com/orgs/WalletConnect/projects/9
# github-token: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
# labeled: accepted
# label-operator: OR
#
# auto-promote:
# name: auto-promote
# if: github.event.action == 'opened'
# runs-on: ubuntu-latest
# steps:
# - name: Check Core Team membership
# uses: tspascoal/get-user-teams-membership@v1
# id: is-core-team
# with:
# username: ${{ github.event_name != 'pull_request' && github.event.issue.user.login || github.event.sender.login }}
# team: "Core Team"
# GITHUB_TOKEN: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
# - name: Print result
# env:
# CREATOR: ${{ github.event_name != 'pull_request' && github.event.issue.user.login || github.event.sender.login }}
# IS_TEAM_MEMBER: ${{ steps.is-core-team.outputs.isTeamMember }}
# run: echo "$CREATOR (Core Team Member $IS_TEAM_MEMBER) created this issue/PR"
# - name: Label issues
# if: ${{ steps.is-core-team.outputs.isTeamMember == 'true' }}
# uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
# with:
# add-labels: "accepted"
# repo-token: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Project Workflows

on:
issues:
types:
- reopened
- closed
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize

env:
project_id: 20
new: πŸ†• New
backlog: πŸ—ƒ Backlog
prioritized: πŸ”– Prioritized
in_progress: πŸ— In progress
blocked: πŸ›‘ Blocked
in_review: πŸ‘€ In review
done: βœ… Done

jobs:

issue_reopened:
name: Issue Reopened
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'reopened'
steps:
- name: Move issue to ${{ env.prioritized }}
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
organization: WalletConnect
project_id: ${{ env.project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
status_value: ${{ env.prioritized }}

issue_closed:
name: issue_closed
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'closed'
steps:
- name: Moved issue to ${{ env.done }}
uses: leonsteinhaeuser/project-beta-automations@v2.1.0
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
organization: WalletConnect
project_id: ${{ env.project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
status_value: ${{ env.done }}

check_pull_requests:
name: Check linked issues
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target'
permissions:
issues: read
pull-requests: write
steps:
- uses: nearform-actions/github-action-check-linked-issues@v1
id: check-linked-issues

0 comments on commit d532305

Please sign in to comment.