-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (83 loc) · 3.24 KB
/
issues-chores.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# This workflow performs various tasks for cleanup, triage, ... on GitHub Issues
name: Issues Chores
on:
workflow_call:
inputs:
instance_type:
type: string
required: false
description: "Type of instances to run the job on (self hosted or ubuntu-latest)"
default: "self-hosted"
jobs:
issues-chores:
name: Issues Chores
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/add-to-github-projects
# Add all issues with need-triage label to the "Bug Triage" project
# Official Action from GitHub
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/Jahia/projects/13
github-token: ${{ secrets.GH_JAHIACI_ISSUES_CHORES }}
labeled: needs-triage
# Transfer issues with label "jahia-only" back to jahia-private
- name: Transfer Issue & Create Stub
uses: lando/transfer-issue-action@v2
with:
token: ${{ secrets.GH_JAHIACI_ISSUES_CHORES }}
router: jahia-only:jahia-private
- name: Update Transferred Issue
uses: actions/github-script@v5
if: steps.transfer-issue.outputs.new_issue_number != ''
with:
script: |
await github.rest.issues.createComment({
issue_number: `${{ steps.transfer-issue.outputs.new_issue_number}}`,
owner: context.repo.owner,
repo: `${{ steps.transfer-issue.outputs.destinatiom_repo }}`,
body: `@${ context.payload.issue.user.login } your issues was moved back to jahia/jahia-private since it contained the jahia-only label!`
});
- uses: actions/github-script@v7
id: issue-details
with:
result-encoding: string
retries: 3
script: |
return JSON.stringify(github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
}))
- name: Hello World
shell: bash
run: |
echo ${{ steps.issue-details.outputs.result}}
- name: Get issue type
id: issue-type
uses: actions/github-script@v7
with:
script: |
if (context.payload.issue.type !== undefined) {
return context.payload.issue.type.name
}
result-encoding: string
- name: Get result
run: echo "${{steps.issue-type.outputs.result}}"
- uses: actions/github-script@v7
id: set-result
with:
script: return "Hello!"
result-encoding: string
- name: Get result
run: echo "${{steps.set-result.outputs.result}}"
# Add all tickets of Type "Epic" and label "Area:" to the global roadmap project
# https://github.com/orgs/Jahia/projects/18
- name: Attach all Epics to the Roadmap - Global project
uses: actions/[email protected]
if: ${{ steps.issue-type.outputs.result == 'Epic' }}
with:
project-url: https://github.com/orgs/Jahia/projects/18
github-token: ${{ secrets.GH_JAHIACI_ISSUES_CHORES }}
labeled: Area:Product, Area:Delivery, Area:Tech, Area:QA, Area:Security
label-operator: OR