-
-
Notifications
You must be signed in to change notification settings - Fork 5
165 lines (159 loc) · 5.33 KB
/
update_demo.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: 🚀 Update Bug Report
on:
# used for testing this action
# you shouldn't use this trigger in production
push:
branches:
- main
# used for testing this action
# you shouldn't use this trigger in production
pull_request:
branches: [main]
# use in production
workflow_dispatch:
# use in production
release:
branches:
- main
types: [published]
# use in production
schedule:
# runs on Monday midnight
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '0 0 * * 1'
jobs:
update-bug-report:
runs-on: ubuntu-latest
name: Update bug report
steps:
- name: Setting branch for committing
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
run: |
BRANCH=""
if [ ${{ github.event_name == 'release' }} == true ]; then
BRANCH=${{ github.event.release.target_commitish }}
elif [ ${{ github.event_name == 'create' }} == true ]; then
BRANCH=${{ github.event.repository.default_branch }}
elif [ ${{ github.event_name == 'pull_request' }} == true ]; then
BRANCH=${{ github.head_ref }}
else
BRANCH=${{ github.ref }}
fi
echo "job_ref=$BRANCH" >> $GITHUB_ENV
echo "Branch: $BRANCH"
- name: Checkout ${{ env.job_ref }}
# used for testing this action, needed to reference the local action
uses: actions/checkout@v3
with:
ref: ${{ env.job_ref }}
- name: Update fabric
id: fabric
uses: ./
with:
package: fabric
dropdown: _fabric
dry_run: no-push
form: .github/ISSUE_TEMPLATE/demo.yml
- name: Update fabric tags
uses: ./
with:
# needed to fetch tags with the github client
github_token: ${{ secrets.GITHUB_TOKEN }}
dropdown: _fabric_tags
registry: github
package: fabricjs/fabric.js
form: .github/ISSUE_TEMPLATE/demo.yml
commit_message: 'chore(): update bug report / fabric'
dry_run: no-push
- name: Update lodash
id: lodash
uses: ./
with:
package: lodash
dropdown: _lodash
limit_to: 20
form: .github/ISSUE_TEMPLATE/demo.yml
commit_message: 'chore(): update bug report / lodash'
dry_run: no-push
- name: Update self
uses: ./
with:
# needed to fetch tags with the github client
github_token: ${{ secrets.GITHUB_TOKEN }}
registry: github
semver: '>=0.1.21'
form: .github/ISSUE_TEMPLATE/demo.yml
dry_run: no-push
- name: Update react-native-math-view
uses: ./
with:
# needed to fetch tags with the github client
github_token: ${{ secrets.GITHUB_TOKEN }}
dropdown: _math
registry: github
package: react-native-math-view
form: .github/ISSUE_TEMPLATE/demo.yml
commit_message: 'chore(): update bug report / math'
dry_run: no-push
- name: Update node
id: node
uses: ./
with:
dropdown: _node_version
package: node
order: asc
limit_to: 15
form: .github/ISSUE_TEMPLATE/demo.yml
commit_message: 'chore(): update bug report / node'
dry_run: no-push
- name: Dry Run Axios
id: axios
uses: ./
with:
package: axios
limit_to: 10
form: .github/ISSUE_TEMPLATE/demo.yml
dry_run: no-write
- name: Dry Run pixijs
id: pixijs
uses: ./
with:
dropdown: _copy
package: pixijs/pixijs
registry: github
limit_to: 10
form: .github/ISSUE_TEMPLATE/demo.yml
dry_run: no-write
- name: Update copy
uses: ./
with:
dropdown: _copy
tags: ${{ steps.axios.outputs.tags }}
form: .github/ISSUE_TEMPLATE/demo.yml
dry_run: no-push
- name: Mock tags
# This step demonstrates how to generate tags
# Consider using the underlying action https://github.com/ShaMan123/gha-form-dropdown-options#issue-forms-dropdown-options directly
id: mock_tags
uses: actions/github-script@v6
env:
NODE_LATEST_VERSION: ${{ steps.node.outputs.latest }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
return ['1.2.3', '4.5.6', '7.8.9', `node@${process.env.NODE_LATEST_VERSION}`, 'fabric@${{ steps.fabric.outputs.latest }}']
.concat(${{ steps.lodash.outputs.tags }}.slice(0, 5).map(tag => `lodash@${tag}`))
.concat(${{ steps.pixijs.outputs.tags }}.slice(0, 5).map(tag => `pixijs@${tag}`));
- name: Update generated
uses: ./
with:
dropdown: _generated
tags: ${{ steps.mock_tags.outputs.result }}
form: .github/ISSUE_TEMPLATE/demo.yml
commit_message: 'chore(): update bug report / generated'
dry_run: no-push
- run: |
if [[ $(git log origin/update-action..update-action | wc -c) -gt 0 ]]; then
git push
fi