Skip to content

Commit

Permalink
Merge pull request #145 from Yashsharma1911/yash/addWorkFlowForKeys
Browse files Browse the repository at this point in the history
Added workflow to fetch keys spreadsheet data
  • Loading branch information
leecalcote authored Jan 23, 2024
2 parents 535d9ff + 79b0c82 commit 2d970ca
Show file tree
Hide file tree
Showing 2 changed files with 585 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/generate_keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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
jobs:
fetch-keys:
name: Fetch Keys
if: github.repository == 'layer5io/docs'
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 1
- name: Set spreadsheet_uri as environment variable
run: echo "spreadsheet_uri=" >> $GITHUB_ENV
if: inputs.spreadshet_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 "./assets/csv/permissions" ] && mkdir -p "./assets/csv/permissions";
mv keys.csv assets/permissions/keys.csv;
- 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: ci@layer5.io
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>author of the commit that triggered the run
Loading

0 comments on commit 2d970ca

Please sign in to comment.