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

[chore] Update import keys workflow to trigger on schedule #324

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
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
52 changes: 27 additions & 25 deletions .github/workflows/generate-keys.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
name: Import Keys
on:
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
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 != ''
- 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=https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=64355745&single=true&output=csv" >> $GITHUB_ENV
if: inputs.spreadsheet_uri != ''
Yashsharma1911 marked this conversation as resolved.
Show resolved Hide resolved
echo "spreadsheet_uri=${{ inputs.spreadsheet_uri }}" >> $GITHUB_ENV

- name: Dump keys from the spreadsheet
run: |
curl -L "${{ inputs.spreadsheet_uri }}" -o "./keys.csv";
- name: Create permissions folder
run: |
[ ! -d "./static/data/csv" ] && mkdir -p "./static/data/csv";
mv keys.csv static/data/csv/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: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>author of the commit that triggered the run
- name: Dump keys from the spreadsheet
run: |
curl -L $spreadsheet_uri -o "./keys.csv";
- name: Create permissions folder
run: |
[ ! -d "./static/data/csv" ] && mkdir -p "./static/data/csv";
mv keys.csv static/data/csv/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: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>author of the commit that triggered the run
Loading