forked from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.89 KB
/
generate_keys.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
name: Import Keys
on:
workflow_dispatch:
inputs:
spreadsheet_uri:
description: Link of the spreadsheet containing keys.
type: string
default: https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=64355745&single=true&output=csv
schedule:
- cron: "0 0 * * *"
jobs:
fetch-keys:
name: Fetch Keys
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 1
- name: Set spreadsheet_uri as environment variable
run: echo "spreadsheet_uri=https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=64355745&single=true&output=csv" >> $GITHUB_ENV
if: inputs.spreadsheet_uri != ''
echo "spreadsheet_uri=${{ inputs.spreadsheet_uri }}" >> $GITHUB_ENV
- name: Dump keys from the spreadsheet
run: |
curl -L "${{ env.spreadsheet_uri }}" -o "./keys.csv";
- name: Create permissions folder
run: |
[ ! -d "./server/permissions" ] && mkdir -p "./server/permissions";
mv keys.csv server/permissions/keys.csv;
- name: Save keys.csv to docs/assets/excel
run: cp server/permissions/keys.csv docs/assets/excel/keys.csv
- name: Pull changes from remote
run: git pull origin master
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Added permissions keys.
branch: master
commit_options: "--signoff"
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>author of the commit that triggered the run