Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created officer data workflow #186

Merged
merged 37 commits into from
Nov 10, 2021
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9242f20
Does this work in prod?? 👀
EthanThatOneKid Oct 20, 2021
0483a94
Created script for updating officer data using a GitHub issue form
EthanThatOneKid Nov 2, 2021
0c6fa27
Merge branch 'main' into fix/54
EthanThatOneKid Nov 8, 2021
8be4716
Updated the update-officer.js script
EthanThatOneKid Nov 8, 2021
a10bef1
Update officer_form.yaml
EthanThatOneKid Nov 8, 2021
1403a55
Added label tags
EthanThatOneKid Nov 8, 2021
44b6f53
Update officer_form.yaml
EthanThatOneKid Nov 8, 2021
7df8881
Replica of fix/54
EthanThatOneKid Nov 8, 2021
8040670
Update officer_form.yaml
EthanThatOneKid Nov 8, 2021
8776ce7
Update update_officer.yaml
EthanThatOneKid Nov 8, 2021
6cae15f
Chaining <https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df88…
EthanThatOneKid Nov 8, 2021
10032f4
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 8, 2021
b37d767
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 8, 2021
ea15b7d
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
bdcb70e
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
fd070d1
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
1853c61
Chain https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888109…
EthanThatOneKid Nov 9, 2021
5976550
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
2319689
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
612ffc0
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
491938f
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/blob/612ffc0c…
EthanThatOneKid Nov 9, 2021
e7f778b
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/blob/612ffc0c…
EthanThatOneKid Nov 9, 2021
22b99b4
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
cee746d
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
708cb71
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
9a51260
Chaining https://github.com/EthanThatOneKid/acmcsuf.com/commit/7df888…
EthanThatOneKid Nov 9, 2021
880afbb
Updated officer update request form
EthanThatOneKid Nov 9, 2021
a3c3071
Merge branch 'main' into fix/54
EthanThatOneKid Nov 9, 2021
ffd30ce
Removed useless console log
EthanThatOneKid Nov 9, 2021
bdd8c32
Delete officer_form.yaml
EthanThatOneKid Nov 9, 2021
cae7abd
Update update_officer.yaml
EthanThatOneKid Nov 9, 2021
7bb8107
Update check_website.yaml
EthanThatOneKid Nov 9, 2021
fd5339c
Merge branch 'main' into fix/54
EthanThatOneKid Nov 9, 2021
55a5b72
Update check_website.yaml
EthanThatOneKid Nov 9, 2021
7e5c455
Improved officer update logic
EthanThatOneKid Nov 9, 2021
fa0f57b
Update update-officer.js
EthanThatOneKid Nov 9, 2021
921b593
Merge branch 'main' into fix/54
EthanThatOneKid Nov 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replica of fix/54
EthanThatOneKid committed Nov 8, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 7df888109c646cf9eb3127b966245c80bf2c802d
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/officer_form.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Officer Form
description: Here is where you can update an acmCSUF officer's information.
labels: 'officer form'

body:
- type: markdown
attributes:
value: |
![banner](https://raw.githubusercontent.com/EthanThatOneKid/acmcsuf.com/main/static/assets/about-illustration.svg)
<small>Note: Banner not included in your published bug report.</small>
- type: input
id: officer_name
attributes:
label: >>Officer Name<<
description: Please enter the name of the officer as seen on https://acmcsuf.com/.
validations:
required: true

- type: dropdown
id: officer_position
attributes:
label: >>Overwrite Officer Position<<
options:
- S21
- F21
- S22
- F22
validations:
required: false

- type: textarea
id: officer_image
attributes:
label: >>Overwrite Officer Image<<
description: |
If an image is detected inside of this textarea, it will be used to update the officer's image on the website.
placeholder: You can attach images by clicking this area to highlight it and then dragging files in.
validations:
required: false
38 changes: 38 additions & 0 deletions .github/workflows/update_officer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update Officer Data

on:
issues:
types: [opened, reopened]

jobs:
update_officer:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Parse Issue Form
id: parse
uses: peter-murray/[email protected]
with:
issue_id: ${{ github.event.issue.number }}
separator: '###'
label_marker_start: '>>'
label_marker_end: '<<'

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Run Update Officer Script
run: npm ci
run: node scripts/update-officer.js "${{ steps.parse.outputs.payload }}"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update officer
title: Update officer
body: Process automated by \#${{ github.event.issue.number }}
branch: update-officers
17 changes: 17 additions & 0 deletions scripts/update-officer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { getNArg } from './common.js';

const updateOfficer = async () => {
const payload = getNArg(2);
console.log('PAYLOAD: ', { payload });
// TODO: Use the data to update the officer data locally.
};

try {
const success = await updateOfficer();
if (success) process.exit(0);
// eslint-disable-next-line no-empty
} catch (error) {
console.error(error);
}

process.exit(1);
240 changes: 240 additions & 0 deletions src/lib/constants/officers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
[
{
"name": "Jacob Nguyen",
"positions": {
"S21": "President, Create Director, NodeBuds Officer"
},
"picture": "jacob-nguyen.png"
},
{
"name": "Aaron Lieberman",
"positions": {
"S21": "Internal Vice President, NodeBuds Officer",
"F21": "President"
},
"picture": "aaron-lieberman.png"
},
{
"name": "Karnikaa Velumani",
"positions": {
"F21": "Vice President"
},
"picture": "karnikaa-velumani.png"
},
{
"name": "Samuel Sandoval",
"positions": {
"S21": "Vice President, Dev Director"
},
"picture": "samuel-sandoval.png"
},
{
"name": "Ethan Davidson",
"positions": {
"F20": "Competition Manager",
"S21": "Webmaster",
"F21": "Webmaster"
},
"picture": "ethan-davidson.png"
},
{
"name": "Andrew Lau",
"positions": {
"S21": "Treasurer"
},
"picture": "andrew-lau.png"
},
{
"name": "Tommy Le",
"positions": {
"F21": "Treasurer"
},
"picture": "tommy-le.png"
},
{
"name": "Jason Anthony",
"positions": {
"S21": "Secretary"
},
"picture": "jason-anthony.png"
},
{
"name": "Nicolas Renteria",
"positions": {
"S21": "Marketing Chair, NodeBuds Officer"
},
"picture": "nicolas-renteria.png"
},
{
"name": "Joshua Hughes",
"positions": {
"S21": "ICC Representative"
},
"picture": "joshua-hughes.png"
},
{
"name": "Wilbert Rodriguez",
"positions": {
"S21": "Intern Program Manager"
},
"picture": "wilbert-rodriguez.png"
},
{
"name": "Shaleen Mathur",
"positions": {
"S21": "Co-Workshop Manager"
},
"picture": "shaleen-mathur.png"
},
{
"name": "Johnson Tong",
"positions": {
"S21": "Co-Workshop Manager"
},
"picture": "johnson-tong.png"
},
{
"name": "Kavit Sanghavi",
"positions": {
"S21": "Algo Director"
},
"picture": "kavit-sanghavi.png"
},
{
"name": "Kevin Dillon",
"positions": {
"S21": "Algo Officer"
},
"picture": "kevin-dillon.png"
},
{
"name": "Parth Sharma",
"positions": {
"S21": "Algo Officer"
},
"picture": "parth-sharma.png"
},
{
"name": "Armanul Ambia",
"positions": {
"S21": "Dev Officer, NodeBuds Officer",
"F21": "Algo Director"
},
"picture": "armanul-ambia.png"
},
{
"name": "Alex Truong",
"positions": {
"F21": "Algo Officer"
},
"picture": "alex-truong.png"
},
{
"name": "Wesley Chou",
"positions": {
"S21": "Dev Officer",
"F21": "Dev Director"
},
"picture": "wesley-chou.png"
},
{
"name": "Andy Lasso",
"positions": {
"F21": "Dev Officer"
},
"picture": "andy-lasso.png"
},
{
"name": "Rina Watanabe",
"positions": {
"F21": "Dev Officer, Project Manager"
},
"picture": "rina-watanabe.png"
},
{
"name": "Jorge Mejia",
"positions": {
"F21": "Dev Officer"
},
"picture": "jorge-mejia.png"
},
{
"name": "Mike Ploythai",
"positions": {
"S21": "Create Officer",
"F21": "Create Director, Marketing Chair"
},
"picture": "mike-ploythai.png"
},
{
"name": "Samuel Valls",
"positions": {
"S21": "Community Manager",
"F21": "Create Officer"
},
"picture": "samuel-valls.png"
},
{
"name": "Lisa Hong",
"positions": {
"S21": "Create Officer"
},
"picture": "lisa-hong.png"
},
{
"name": "Kayla Nguyen",
"positions": {
"F21": "Create Officer"
},
"picture": "kayla-nguyen.png"
},
{
"name": "Serena Naranjo",
"positions": {
"F21": "Create Officer"
},
"picture": "serena-naranjo.png"
},
{
"name": "Taylor Noh",
"positions": {
"S21": "NodeBuds Officer"
},
"picture": "taylor-noh.png"
},
{
"name": "Eugene Lee",
"positions": {
"S21": "NodeBuds Officer"
},
"picture": "eugene-lee.png"
},
{
"name": "Sami Bajwa",
"positions": {
"F21": "NodeBuds Officer"
},
"picture": "sami-bajwa.png"
},
{
"name": "Eduardo Gomez",
"positions": {
"S21": "NodeBuds Officer"
},
"picture": "eduardo-gomez.png"
},
{
"name": "Ean McGilvery",
"positions": {
"S21": "NodeBuds Officer"
},
"picture": "ean-mcgilvery.png"
},
{
"name": "Dalisa Nguyen",
"positions": {
"S21": "NodeBuds Officer"
},
"picture": "dalisa-nguyen.png"
}
]
203 changes: 4 additions & 199 deletions src/lib/constants/officers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import OFFICERS_JSON from './officers.json';

export interface Officer {
name: string;
positions: Record<string, string>;
@@ -11,203 +13,6 @@ export const TERM_FALL_21 = 'F21';

export const TERMS = [TERM_FALL_21, TERM_SPRING_21];

export const OFFICERS: Officer[] = [
{
name: 'Jacob Nguyen',
positions: { [TERM_SPRING_21]: 'President, Create Director, NodeBuds Officer' },
picture: 'jacob-nguyen.png',
},
{
name: 'Aaron Lieberman',
positions: {
[TERM_SPRING_21]: 'Internal Vice President, NodeBuds Officer',
[TERM_FALL_21]: 'President',
},
picture: 'aaron-lieberman.png',
},
{
name: 'Karnikaa Velumani',
positions: { [TERM_FALL_21]: 'Vice President' },
picture: 'karnikaa-velumani.png',
},
{
name: 'Samuel Sandoval',
positions: { [TERM_SPRING_21]: 'Vice President, Dev Director' },
picture: 'samuel-sandoval.png',
},
{
name: 'Ethan Davidson',
positions: {
[TERM_FALL_20]: 'Competition Manager',
[TERM_SPRING_21]: 'Webmaster',
[TERM_FALL_21]: 'Webmaster',
},
picture: 'ethan-davidson.png',
//url: "https://github.com/EthanThatOneKid/",
},
{
name: 'Andrew Lau',
positions: { [TERM_SPRING_21]: 'Treasurer' },
picture: 'andrew-lau.png',
},
{
name: 'Tommy Le',
positions: { [TERM_FALL_21]: 'Treasurer' },
picture: 'tommy-le.png',
},
{
name: 'Jason Anthony',
positions: { [TERM_SPRING_21]: 'Secretary' },
picture: 'jason-anthony.png',
},
{
name: 'Nicolas Renteria',
positions: { [TERM_SPRING_21]: 'Marketing Chair, NodeBuds Officer' },
picture: 'nicolas-renteria.png',
},
{
name: 'Joshua Hughes',
positions: { [TERM_SPRING_21]: 'ICC Representative' },
picture: 'joshua-hughes.png',
},
{
name: 'Wilbert Rodriguez',
positions: { [TERM_SPRING_21]: 'Intern Program Manager' },
picture: 'wilbert-rodriguez.png',
},
{
name: 'Shaleen Mathur',
positions: { [TERM_SPRING_21]: 'Co-Workshop Manager' },
picture: 'shaleen-mathur.png',
},
{
name: 'Johnson Tong',
positions: { [TERM_SPRING_21]: 'Co-Workshop Manager' },
picture: 'johnson-tong.png',
},
{
name: 'Kavit Sanghavi',
positions: { [TERM_SPRING_21]: 'Algo Director' },
picture: 'kavit-sanghavi.png',
},
{
name: 'Kevin Dillon',
positions: { [TERM_SPRING_21]: 'Algo Officer' },
picture: 'kevin-dillon.png',
},
{
name: 'Parth Sharma',
positions: { [TERM_SPRING_21]: 'Algo Officer' },
picture: 'parth-sharma.png',
},
{
name: 'Armanul Ambia',
positions: {
[TERM_SPRING_21]: 'Dev Officer, NodeBuds Officer',
[TERM_FALL_21]: 'Algo Director',
},
picture: 'armanul-ambia.png',
},
{
name: 'Alex Truong',
positions: { [TERM_FALL_21]: 'Algo Officer' },
picture: 'alex-truong.png',
},
{
name: 'Wesley Chou',
positions: {
[TERM_SPRING_21]: 'Dev Officer',
[TERM_FALL_21]: 'Dev Director',
},
picture: 'wesley-chou.png',
},
{
name: 'Andy Lasso',
positions: { [TERM_FALL_21]: 'Dev Officer' },
picture: 'andy-lasso.png',
},
{
name: 'Rina Watanabe',
positions: { [TERM_FALL_21]: 'Dev Officer, Project Manager' },
picture: 'rina-watanabe.png',
},
{
name: 'Jorge Mejia',
positions: { [TERM_FALL_21]: 'Dev Officer' },
picture: 'jorge-mejia.png',
},
{
name: 'Johnathan Carranza',
positions: { [TERM_FALL_21]: 'Dev Officer' },
picture: 'johnathan-carranza.png',
},
{
name: 'Mike Ploythai',
positions: {
[TERM_SPRING_21]: 'Create Officer',
[TERM_FALL_21]: 'Create Director, Marketing Chair',
},
picture: 'mike-ploythai.png',
},
{
name: 'Samuel Valls',
positions: {
[TERM_SPRING_21]: 'Community Manager',
[TERM_FALL_21]: 'Create Officer',
},
picture: 'samuel-valls.png',
},
{
name: 'Lisa Hong',
positions: { [TERM_SPRING_21]: 'Create Officer' },
picture: 'lisa-hong.png',
},
{
name: 'Kayla Nguyen',
positions: { [TERM_FALL_21]: 'Create Officer' },
picture: 'kayla-nguyen.png',
},
{
name: 'Serena Naranjo',
positions: { [TERM_FALL_21]: 'Create Officer' },
picture: 'serena-naranjo.png',
},
{
name: 'Taylor Noh',
positions: {
[TERM_SPRING_21]: 'NodeBuds Officer',
},
picture: 'taylor-noh.png',
},
{
name: 'Eugene Lee',
positions: { [TERM_SPRING_21]: 'NodeBuds Officer' },
picture: 'eugene-lee.png',
},
{
name: 'Sami Bajwa',
positions: { [TERM_FALL_21]: 'NodeBuds Officer' },
picture: 'sami-bajwa.png',
},
{
name: 'Eduardo Gomez',
positions: { [TERM_SPRING_21]: 'NodeBuds Officer' },
picture: 'eduardo-gomez.png',
},
{
name: 'Ean McGilvery',
positions: { [TERM_SPRING_21]: 'NodeBuds Officer' },
picture: 'ean-mcgilvery.png',
},
{
name: 'Dalisa Nguyen',
positions: { [TERM_SPRING_21]: 'NodeBuds Officer' },
picture: 'dalisa-nguyen.png',
},
];
export const OFFICERS: Officer[] = [...OFFICERS_JSON];

// TODO: Implement visual effect based on path.
// export interface Position {
// title: string; // HTML string
// path: "general" | "algo" | "create" | "dev";
// }
console.log(JSON.stringify(OFFICERS, null, 2));