generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meeting-template: Add attendees function
Fixes #77
- Loading branch information
Showing
5 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as core from '@actions/core' | ||
import axios from 'axios' | ||
|
||
export async function GetAttendees(): Promise<string> { | ||
try { | ||
console.log(`GetAttendees started`) | ||
// Fetch the attendees from the specified URL | ||
const fetchedRollCall = await fetchData(core.getInput('peopleListURL')) | ||
const peopleList = fetchedRollCall.split('\n').slice(1).join(' ') | ||
console.log(peopleList) | ||
|
||
return peopleList | ||
} catch (error) { | ||
// Fail the workflow run if an error occurs | ||
if (error instanceof Error) core.setFailed(error.message) | ||
return `Failed to get attendees. Check here https://github.com/coreos/fedora-coreos-tracker/blob/main/meeting-people.txt` | ||
} | ||
} | ||
|
||
async function fetchData(url: string): Promise<string> { | ||
const options = { | ||
method: `GET`, | ||
url | ||
} | ||
return (await axios(options)).data | ||
} |
This file contains 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
This file contains 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