Feature List #22
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
name: Feature List | |
on: | |
workflow_dispatch: | |
inputs: | |
spreadsheet_uri: | |
description: 'Link of the spreadsheet containing subscription details.' | |
type: string | |
required: true | |
schedule: | |
- cron: '0 0 * * *' # Runs every day at midnight UTC | |
permissions: | |
contents: write | |
jobs: | |
fetch-Feature-list: | |
name: Fetch Feature List | |
if: github.repository == 'layer5labs/meshery-extensions-packages' | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository to access local files | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Step 2: Install Go (if it's not pre-installed) | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ secrets.GO_VERSION }} | |
# Step 3: Set environment variable for spreadsheet URL | |
- name: Set spreadsheet URI | |
run: | | |
if [ -n "${{ inputs.spreadsheet_uri }}" ]; then | |
echo "INPUT_SPREADSHEET_URI=${{ inputs.spreadsheet_uri }}" >> $GITHUB_ENV | |
else | |
echo "INPUT_SPREADSHEET_URI=https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=829069645&single=true&output=csv" >> $GITHUB_ENV | |
fi | |
# Step 4: Fetch and process the feature list by directly running the Go file | |
- name: Fetch and process feature list | |
run: | | |
go run ./.github/actions/feature-list-action/main.go | |
- name: Pull changes from remote | |
run: git pull origin master | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
with: | |
commit_message: "Updated feature data" | |
branch: master | |
commit_options: "--signoff" | |
file_pattern: 'feature_data.json' | |
commit_user_name: l5io | |
commit_user_email: [email protected] | |
commit_author: 'l5io <[email protected]>' |