File tree Expand file tree Collapse file tree 3 files changed +45
-20
lines changed Expand file tree Collapse file tree 3 files changed +45
-20
lines changed Original file line number Diff line number Diff line change @@ -98948,19 +98948,23 @@ var __webpack_exports__ = {}
98948
98948
}
98949
98949
}
98950
98950
98951
- if (locations && locations.length > 0) {
98952
- const locationLookup = locations.find((l) => l.id === location.id)
98953
- if (!locationLookup) {
98954
- event.location = location.text
98955
- } else {
98956
- event.location = locationLookup.name
98957
- if (locationLookup.geo) {
98958
- const [lat, lon] = locationLookup.geo
98959
- event.geo = { lat, lon }
98951
+ if (location) {
98952
+ if (locations && locations.length > 0) {
98953
+ const locationLookup = locations.find((l) => l.id === location.id)
98954
+ if (!locationLookup) {
98955
+ event.location = location.text
98956
+ } else {
98957
+ event.location = locationLookup.name
98958
+ if (locationLookup.geo) {
98959
+ const [lat, lon] = locationLookup.geo
98960
+ event.geo = { lat, lon }
98961
+ }
98960
98962
}
98963
+ } else {
98964
+ event.location = location.text ? location.text : ''
98961
98965
}
98962
98966
} else {
98963
- event.location = location.text ? location.text : ''
98967
+ event.location = ''
98964
98968
}
98965
98969
98966
98970
events.push(event)
Original file line number Diff line number Diff line change
1
+ import github from '@actions/github'
2
+ import { createIcs } from '../src/create-ics.js'
3
+ import { fetchIssues } from '../src/fetch-issues.js'
4
+
5
+ async function run ( ) {
6
+ const repoToken = process . env . GH_TOKEN
7
+ const locationsFile = 'locations.json'
8
+ const timeZone = 'America/Denver'
9
+
10
+ const octokit = github . getOctokit ( repoToken )
11
+
12
+ const events = await fetchIssues ( octokit , locationsFile , timeZone )
13
+
14
+ await createIcs ( events )
15
+ }
16
+
17
+ run ( )
Original file line number Diff line number Diff line change @@ -134,19 +134,23 @@ export async function fetchIssues(
134
134
}
135
135
}
136
136
137
- if ( locations && locations . length > 0 ) {
138
- const locationLookup = locations . find ( ( l ) => l . id === location . id )
139
- if ( ! locationLookup ) {
140
- event . location = location . text
141
- } else {
142
- event . location = locationLookup . name
143
- if ( locationLookup . geo ) {
144
- const [ lat , lon ] = locationLookup . geo
145
- event . geo = { lat, lon }
137
+ if ( location ) {
138
+ if ( locations && locations . length > 0 ) {
139
+ const locationLookup = locations . find ( ( l ) => l . id === location . id )
140
+ if ( ! locationLookup ) {
141
+ event . location = location . text
142
+ } else {
143
+ event . location = locationLookup . name
144
+ if ( locationLookup . geo ) {
145
+ const [ lat , lon ] = locationLookup . geo
146
+ event . geo = { lat, lon }
147
+ }
146
148
}
149
+ } else {
150
+ event . location = location . text ? location . text : ''
147
151
}
148
152
} else {
149
- event . location = location . text ? location . text : ''
153
+ event . location = ''
150
154
}
151
155
152
156
events . push ( event )
You can’t perform that action at this time.
0 commit comments