File tree Expand file tree Collapse file tree 2 files changed +67
-3
lines changed Expand file tree Collapse file tree 2 files changed +67
-3
lines changed Original file line number Diff line number Diff line change 14
14
- run : echo "🌙 Shamshir was automatically triggered by a ${{ github.event_name }} event."
15
15
- uses : actions/checkout@v2
16
16
- run : npm install
17
- - run : npm cache clean -f
18
17
- id : shamshir-run
19
- uses : kyagi/shamshir@main
18
+ uses : kyagi/shamshir@v1
20
19
with :
21
20
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
22
21
owner : ${{ github.repository_owner }}
Original file line number Diff line number Diff line change @@ -68,4 +68,69 @@ $ node shamshir.js --owner kyagi --repo awesome-project --label releasable --quo
68
68
--help Show help
69
69
```
70
70
### On Github Actions
71
- TBD
71
+ #### Setup
72
+ 1 . Place action.yml in your project top directory.
73
+
74
+ action.yml
75
+ ```
76
+ name: 'Shamshir'
77
+ description: 'Attach a label to pull requests based on the number of approvals'
78
+ author: 'Your name'
79
+
80
+ inputs:
81
+ GITHUB_TOKEN:
82
+ description: 'GitHub token'
83
+ required: true
84
+ owner:
85
+ description: 'Github repository owner'
86
+ required: true
87
+ repo:
88
+ description: 'Github repository'
89
+ required: true
90
+ label:
91
+ description: 'Github label'
92
+ required: true
93
+ quorum:
94
+ description: 'The quorum of approval'
95
+ required: true
96
+
97
+ outputs:
98
+ log:
99
+ description: 'shamshir-run log message for github actions'
100
+
101
+ runs:
102
+ using: 'node16'
103
+ main: 'dist/index.js'
104
+ ```
105
+
106
+ 2 . Place shamshir.yml in your .github/workflows directory.
107
+
108
+ shamshir.yml
109
+ ```
110
+ name: Shamshir
111
+ on:
112
+ pull_request_review:
113
+ types: [submitted, edited, dismissed]
114
+ pull_request:
115
+ types: [edited, labeld, unlabeled]
116
+ # schedule:
117
+ # - cron: '0,30 0-10 * * 1-5'
118
+
119
+ jobs:
120
+ Labeling:
121
+ runs-on: ubuntu-latest
122
+ steps:
123
+ - run: echo "🌙 Shamshir was automatically triggered by a ${{ github.event_name }} event."
124
+ - uses: actions/checkout@v2
125
+ - run: npm install
126
+ - id: shamshir-run
127
+ uses: kyagi/shamshir@v1
128
+ with:
129
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130
+ owner: ${{ github.repository_owner }}
131
+ repo: ${{ github.repository }}
132
+ label: 'releasable'
133
+ quorum: '1'
134
+ - run: echo "${{ steps.shamshir-run.outputs.log }}"
135
+ - run: echo "🌙 Shamshir's status is ${{ job.status }}."
136
+ ```
You can’t perform that action at this time.
0 commit comments