chore(deps-frontend)(deps): bump the minor-and-patch group in /frontend with 3 updates #143
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Project Automation" | |
| on: | |
| issues: | |
| types: [opened, reopened] | |
| pull_request: | |
| types: [opened, closed, reopened] | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| contents: read | |
| env: | |
| PROJECT_ID: "PVT_kwHOAeOTfc4BZzTY" | |
| ASSIGNEE: "overwrite00" | |
| jobs: | |
| add-to-project: | |
| name: "Add to Project & Assign" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Assign and Add to Project" | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PROJECT_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| ASSIGNEE="${{ env.ASSIGNEE }}" | |
| PROJECT_ID="${{ env.PROJECT_ID }}" | |
| add_to_project() { | |
| local content_id="$1" | |
| gh api graphql -f query=' | |
| mutation($project: ID!, $content: ID!) { | |
| addProjectV2ItemById(input: { projectId: $project, contentId: $content }) { | |
| item { id } | |
| } | |
| }' -f project="$PROJECT_ID" -f content="$content_id" >/dev/null \ | |
| && echo " Added to Project" || echo " Failed to add to Project" | |
| } | |
| # Se Issue | |
| if [ "${{ github.event_name }}" = "issues" ]; then | |
| ISSUE_NUM="${{ github.event.issue.number }}" | |
| ISSUE_NODE_ID="${{ github.event.issue.node_id }}" | |
| echo "Processing Issue #$ISSUE_NUM..." | |
| # Assegna Issue | |
| echo " - Assigning to $ASSIGNEE..." | |
| gh issue edit "$ISSUE_NUM" --add-assignee "$ASSIGNEE" && echo " Assigned" || echo " Failed to assign" | |
| # Aggiungi al Project (via GraphQL, non richiede risoluzione per titolo) | |
| echo " - Adding to Project..." | |
| add_to_project "$ISSUE_NODE_ID" | |
| fi | |
| # Se Pull Request | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| PR_NUM="${{ github.event.pull_request.number }}" | |
| PR_ACTION="${{ github.event.action }}" | |
| PR_NODE_ID="${{ github.event.pull_request.node_id }}" | |
| echo "Processing PR #$PR_NUM ($PR_ACTION)..." | |
| # Assegna PR | |
| echo " - Assigning to $ASSIGNEE..." | |
| gh pr edit "$PR_NUM" --add-assignee "$ASSIGNEE" && echo " Assigned" || echo " Failed to assign" | |
| # Aggiungi al Project e richiedi reviewer (solo se opened o reopened) | |
| if [ "$PR_ACTION" = "opened" ] || [ "$PR_ACTION" = "reopened" ]; then | |
| echo " - Adding to Project..." | |
| add_to_project "$PR_NODE_ID" | |
| echo " - Requesting reviewer..." | |
| gh pr edit "$PR_NUM" --add-reviewer "$ASSIGNEE" && echo " Reviewer requested successfully" || echo " Failed to request reviewer" | |
| fi | |
| # Se PR è stato chiuso | |
| if [ "$PR_ACTION" = "closed" ]; then | |
| echo " - PR closed" | |
| if gh pr view "$PR_NUM" --json merged --jq '.merged' | grep -q true; then | |
| echo " PR merged - Item will auto-transition in Project" | |
| fi | |
| fi | |
| fi | |
| - name: "Workflow Summary" | |
| if: always() | |
| run: | | |
| echo "Project automation completed" | |
| echo "Project ID: ${{ env.PROJECT_ID }}" | |
| echo "Assignee: ${{ env.ASSIGNEE }}" |