-
-
Notifications
You must be signed in to change notification settings - Fork 2
Rebuild home_valueXX_icon_color engine
#10
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
Merged
Merged
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d560931
Rebuild `home_valueXX_icon_color` engine
edwardtfn da2f5ca
Merge branch 'main' into v9999.99.9
edwardtfn 1f253dd
Use valid Jinja expression in value color/icon guards
edwardtfn 5f25295
Automatic versioning
edwardtfn 78e5b32
style: auto-fix markdown lint issues
edwardtfn 3c30041
Potential fix for code scanning alert no. 28: Workflow does not conta…
edwardtfn 42c8521
Fix file reference
edwardtfn 106ca39
Merge branch 'v9999.99.9' of https://github.com/edwardtfn/NSPanel-Eas…
edwardtfn f1e686c
style: auto-fix markdown lint issues
edwardtfn 4e01343
Merge branch 'main' into v9999.99.9
edwardtfn 7d0f7e8
Avoid force‑pushing all tags
edwardtfn b54bb88
Merge branch 'v9999.99.9' of https://github.com/edwardtfn/NSPanel-Eas…
edwardtfn bfb5eab
Clarify tag backups
edwardtfn 38ad27d
active voice for clarity
edwardtfn 5c4b6fc
Fix command injection vulnerability in tag message generation: quote …
edwardtfn be60f3d
Remove documentation describes temp branch workflow that doesn't exist
edwardtfn 253845d
📝 CodeRabbit Chat: Add unit tests
coderabbitai[bot] ac9b218
lint
edwardtfn 2ee0d20
Add Sponsor via GitHub
edwardtfn 8993d54
Merge branch 'v9999.99.9' of https://github.com/edwardtfn/NSPanel-Eas…
edwardtfn a00e8e0
Fix start/end markers
edwardtfn 9dde51d
Update .test/unit/test_versioning_advanced.py
edwardtfn 2205fbe
Hardcoded absolute paths will break portability
edwardtfn 9d25f35
Update .test/unit/test_versioning.py
edwardtfn 6b68fb9
Merge branch 'v9999.99.9' of https://github.com/edwardtfn/NSPanel-Eas…
edwardtfn 00666b7
Update .test/unit/test_versioning.py
edwardtfn 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 hidden or 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 |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| # These are supported funding model platforms | ||
|
|
||
| --- | ||
| buy_me_a_coffee: edwardfirmo | ||
| github: edwardtfn | ||
| liberapay: edwardtfn | ||
| github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
| patreon: # Replace with a single Patreon username | ||
| open_collective: # Replace with a single Open Collective username | ||
| ko_fi: # Replace with a single Ko-fi username | ||
| tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
| community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
| issuehunt: # Replace with a single IssueHunt username | ||
| lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
| polar: # Replace with a single Polar username | ||
| thanks_dev: # Replace with a single thanks.dev username | ||
| custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] | ||
| patreon: # Replace with a single Patreon username | ||
| open_collective: # Replace with a single Open Collective username | ||
| ko_fi: # Replace with a single Ko-fi username | ||
| tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
| community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
| issuehunt: # Replace with a single IssueHunt username | ||
| lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
| polar: # Replace with a single Polar username | ||
| thanks_dev: # Replace with a single thanks.dev username | ||
| custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] | ||
| ... |
This file contains hidden or 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,189 @@ | ||
| # This GitHub Actions workflow handles version bumping and tag updates. | ||
| # It can be triggered either by: | ||
| # 1. Pushing to main branch - automatically bumps version and updates tags | ||
| # 2. Manual dispatch - allows independent control over stable and latest tags | ||
|
|
||
| --- | ||
| name: Version and Tags | ||
|
|
||
| on: # yamllint disable-line rule:truthy | ||
| push: | ||
| branches: | ||
| - main | ||
| paths-ignore: | ||
| - '**/VERSION' | ||
| - '**/VERSION_YAML' | ||
|
|
||
| workflow_dispatch: | ||
| inputs: | ||
| update_stable: | ||
| description: "Update stable tag?" | ||
| required: true | ||
| default: false | ||
| type: boolean | ||
| update_latest: | ||
| description: "Update latest tag?" | ||
| required: true | ||
| default: false | ||
| type: boolean | ||
|
|
||
| jobs: | ||
| version-and-tag: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: read | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Git | ||
| run: | | ||
| git config user.name "GitHub Actions" | ||
| git config user.email "actions@github.com" | ||
|
|
||
| - name: Get PR information | ||
| id: pr_info | ||
| if: github.event_name == 'push' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| try { | ||
| // Use GitHub's reliable API to find PRs associated with this commit | ||
| const { data: associatedPRs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| commit_sha: context.sha | ||
| }); | ||
|
|
||
| if (associatedPRs.length > 0) { | ||
| // Get the most recent merged PR | ||
| const pr = associatedPRs.find(pr => pr.state === 'closed' && pr.merged_at) || associatedPRs[0]; | ||
|
|
||
| return { | ||
| title: pr.title, | ||
| body: pr.body || 'No description provided', | ||
| number: pr.number, | ||
| found: true | ||
| }; | ||
| } else { | ||
| // Fallback for direct pushes or when no PR is found | ||
| const commit = await github.rest.repos.getCommit({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| ref: context.sha | ||
| }); | ||
|
|
||
| return { | ||
| title: 'Direct push to main', | ||
| body: commit.data.commit.message, | ||
| number: null, | ||
| found: false | ||
| }; | ||
| } | ||
| } catch (error) { | ||
| console.log('Could not get PR info:', error.message); | ||
| return { | ||
| title: 'Version update', | ||
| body: 'Automated version bump', | ||
| number: null, | ||
| found: false | ||
| }; | ||
| } | ||
|
|
||
| - name: Bump version | ||
| run: | | ||
| chmod +x ./versioning/bump_version.sh | ||
| ./versioning/bump_version.sh | ||
|
|
||
| - name: Create tag message | ||
| id: tag_message | ||
| env: | ||
| PR_TITLE: ${{ github.event_name == 'push' && steps.pr_info.outcome == 'success' && fromJson(steps.pr_info.outputs.result).title || '' }} | ||
| PR_BODY: ${{ github.event_name == 'push' && steps.pr_info.outcome == 'success' && fromJson(steps.pr_info.outputs.result).body || '' }} | ||
| run: | | ||
| NEW_VERSION=$(cat ./versioning/VERSION) | ||
|
|
||
| if [ "${{ github.event_name }}" == "push" ] && [ "${{ steps.pr_info.outcome }}" == "success" ]; then | ||
| { | ||
| printf '# v%s - %s\n\n' "$NEW_VERSION" "$PR_TITLE" | ||
| printf '%s\n' "$PR_BODY" | ||
| } > tag_message.txt | ||
| else | ||
| # Manual dispatch or PR info unavailable - simpler message | ||
| cat > tag_message.txt << EOF | ||
| # v${NEW_VERSION} - Manual tag update | ||
|
|
||
| Tag updated via manual workflow dispatch. | ||
| EOF | ||
| fi | ||
edwardtfn marked this conversation as resolved.
Show resolved
Hide resolved
edwardtfn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Store the message for use in subsequent steps | ||
| echo "TAG_MESSAGE_FILE=tag_message.txt" >> $GITHUB_ENV | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Push Changes and Tags | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| NEW_VERSION=$(cat ./versioning/VERSION) | ||
| git push origin main | ||
| git push origin "v${NEW_VERSION}" | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Update stable tag | ||
| if: | | ||
| success() && ( | ||
| github.event_name == 'workflow_dispatch' && inputs.update_stable || | ||
| github.event_name == 'push' | ||
| ) | ||
| run: | | ||
| # Verify version bump was successful | ||
| if [ ! -f "./versioning/VERSION" ]; then | ||
| echo "Error: VERSION file not found. Version bump may have failed." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Capture existing tag SHA for logging | ||
| if git rev-parse --verify stable >/dev/null 2>&1; then | ||
| OLD_STABLE=$(git rev-parse stable) | ||
| echo "Backing up current stable tag ($OLD_STABLE)" | ||
| fi | ||
|
|
||
| # Update tag with detailed message | ||
| NEW_VERSION=$(cat ./versioning/VERSION) | ||
| echo "Updating stable tag to $NEW_VERSION" | ||
| git tag -fa stable -F "$TAG_MESSAGE_FILE" | ||
| git push origin stable --force | ||
|
|
||
| - name: Update latest tag | ||
| if: | | ||
| success() && ( | ||
| github.event_name == 'workflow_dispatch' && inputs.update_latest || | ||
| github.event_name == 'push' | ||
| ) | ||
| run: | | ||
| # Verify version bump was successful | ||
| if [ ! -f "./versioning/VERSION" ]; then | ||
| echo "Error: VERSION file not found. Version bump may have failed." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Capture existing tag SHA for logging | ||
| if git rev-parse --verify latest >/dev/null 2>&1; then | ||
| OLD_LATEST=$(git rev-parse latest) | ||
| echo "Backing up current latest tag ($OLD_LATEST)" | ||
| fi | ||
|
|
||
| # Update tag with detailed message | ||
| NEW_VERSION=$(cat ./versioning/VERSION) | ||
| echo "Updating latest tag to $NEW_VERSION" | ||
| git tag -fa latest -F "$TAG_MESSAGE_FILE" | ||
| git push origin latest --force | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: | | ||
| # Clean up temporary files | ||
| [ -f tag_message.txt ] && rm tag_message.txt || true | ||
|
||
| ... | ||
Empty file.
Empty file.
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.
Uh oh!
There was an error while loading. Please reload this page.