-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pricing list reuseable workflow call #5919
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d8761b2
pricing list reuseable workflow call
SAHU-01 f07edcb
[UI] updating pricing list page ui based on workflow
SAHU-01 13bcf68
[UI] updating pricing list page ui based on workflow
SAHU-01 821e9f2
Fixed props error
SAHU-01 e37e73d
Merge branch 'master' into pricing-list
sudhanshutech 1f52a97
Renaming to feature list and workflow updated
SAHU-01 b34e647
Merge branch 'layer5io:master' into pricing-list
SAHU-01 9bf3b46
file path updated
SAHU-01 f0214ad
Updating pricing data content
SAHU-01 468751f
removign all occurances of pricing from code
SAHU-01 06bf498
Tags for pricing page
SAHU-01 661ca03
Tags data test for pricing page
SAHU-01 6af6a42
workflow commit author update
SAHU-01 80e17d9
Merge branch 'master' into pricing-list
sudhanshutech 7e869ab
removing sample team beta data
SAHU-01 6774d51
Merge branch 'pricing-list' of https://github.com/SAHU-01/layer5 into…
SAHU-01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
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 * * *' | ||
|
||
permissions: | ||
contents: write | ||
actions: read | ||
|
||
jobs: | ||
trigger-feature-list: | ||
runs-on: ubuntu-latest | ||
env: | ||
FEATURES_FILE: 'feature_data.json' | ||
|
||
steps: | ||
- name: Checkout current repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore cache | ||
id: cache-sha | ||
uses: actions/cache@v3 | ||
with: | ||
path: .sha-cache | ||
key: feature-data-sha | ||
restore-keys: | | ||
feature-data-sha | ||
|
||
- name: Check for updates in source repository | ||
id: check-updates | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const { data: sourceFile } = await github.rest.repos.getContent({ | ||
owner: 'layer5labs', | ||
repo: 'meshery-extensions-packages', | ||
path: 'feature_data.json', | ||
ref: 'master' | ||
}); | ||
|
||
// Store the latest commit SHA | ||
const latestSHA = sourceFile.sha; | ||
|
||
const fs = require('fs'); | ||
|
||
// Check if we have a previous SHA | ||
let hasUpdates = true; | ||
const shaCachePath = '.sha-cache/latest-sha'; | ||
if (fs.existsSync(shaCachePath)) { | ||
const lastSHA = fs.readFileSync(shaCachePath, 'utf8'); | ||
hasUpdates = lastSHA !== latestSHA; | ||
} | ||
|
||
if (hasUpdates) { | ||
// Save the new SHA | ||
fs.mkdirSync('.sha-cache', { recursive: true }); | ||
fs.writeFileSync(shaCachePath, latestSHA); | ||
|
||
// Decode and save the content | ||
const content = Buffer.from(sourceFile.content, 'base64').toString('utf8'); | ||
|
||
// Write the new content | ||
fs.writeFileSync(process.env.FEATURES_FILE, content); | ||
|
||
core.setOutput('has-updates', 'true'); | ||
} else { | ||
core.setOutput('has-updates', 'false'); | ||
} | ||
|
||
- name: Commit changes | ||
if: steps.check-updates.outputs.has-updates == 'true' | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "Updated feature data from source repository" | ||
file_pattern: ${{ env.FEATURES_FILE }} | ||
branch: master | ||
commit_options: "--signoff" | ||
commit_user_name: l5io | ||
commit_user_email: [email protected] | ||
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This github.actor is fragile, sometimes it willl refer to the person who merge this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What possible fix would you suggest for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jerensl any reference or example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/layer5labs/meshery-extensions-packages/blob/master/.github/workflows/generate-feature-list.yml#L62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks jeren, @SAHU-01 lets finish this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, @sudhanshutech !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets give a final review on the call by everyone then will merge.